Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JPG文件显示File not found #14

Open
gzelvis opened this issue Apr 2, 2018 · 12 comments

Comments

@gzelvis
Copy link

commented Apr 2, 2018

其它下载文件格式的都没问题(MP4也没问题),但上传jpg的话,就会显示404 not found,不知道是我设置错了还是咋的

@donwa

This comment has been minimized.

Copy link
Owner

commented Apr 3, 2018

尝试删除 cache/ 目录下缓存文件。

@gzelvis

This comment has been minimized.

Copy link
Author

commented Apr 3, 2018

已经尝试删除cache下的文件,因为第一次的时候使用sqlite模式,删除了这个,不行。然后换用file模式,也是不行。。。邪门。会是nginx rewite的问题吗?但应该不会啊,因为除了图片文件,其它文件都可以正常下载

@gzelvis

This comment has been minimized.

Copy link
Author

commented Apr 3, 2018

看你V2上的帖子。http://xn.tn/bg.jpg 也是打不开的。貌似是图片文件不行?

@donwa

This comment has been minimized.

Copy link
Owner

commented Apr 3, 2018

可能是你的rewite的问题吧。帖子中插入的图片,我这里显示正常。
bg.jpg

@gzelvis

This comment has been minimized.

Copy link
Author

commented Apr 3, 2018

果然,的确是我nginx rewrite设置的问题。现在图片可以引用了。但那个thumbnails=small 貌似不好用? 会不会是把那个?号rewrite后造成的?

@donwa

This comment has been minimized.

Copy link
Owner

commented Apr 4, 2018

@gzelvis 如果你的链接是/?/的话,就要用/?/&thumbnails=small

@xugui0821

This comment has been minimized.

Copy link

commented Apr 5, 2018

你用的是宝塔吧,把站点配置文件里的这部分删掉就行了
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
access_log off;
}

location ~ .*\.(js|css)?$
{
    expires      12h;
    access_log off; 
}
@gzelvis

This comment has been minimized.

Copy link
Author

commented Apr 6, 2018

回楼上,的确就是这几句配置的问题,其实我之前已经删掉能用了。不过还是谢谢你

@platoer

This comment has been minimized.

Copy link

commented Apr 20, 2018

@gzelvis nginx rewrite 您是怎么改的?我的也是出现图片问题,能否分享以下

@cjpjxjx

This comment has been minimized.

Copy link

commented May 7, 2018

使用宝塔面板的,我之前也是JPG图片打不开,后来发现只需要添加伪静态即可,宝塔有个Apache转Nginx工具,把根目录.htaccess里的内容转换一下添加到伪静态即可,不需要改站点配置文件,转换好的代码:
if (!-f $request_filename){
set $rule_0 1$rule_0;
}
if (!-d $request_filename){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)$ /index.php?/$1 last;
}

@ipme

This comment has been minimized.

Copy link

commented Jun 4, 2018

怎么显示不了 远程文件..
难道是伪静态? nginx的

@amrice

This comment has been minimized.

Copy link

commented Sep 5, 2018

顺着某博客找到这里,成功解决,感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.