- off - disables compression for all proxied requests
- expired - enables compression, if the "Expires" header prevents caching
- no-cache - enables compression if "Cache-Control" header is set to "no-cache"
- no-store - enables compression if "Cache-Control" header is set to "no-store"
- private - enables compression if "Cache-Control" header is set to "private"
- no_last_modified - enables compression if "Last-Modified" isn't set
- no_etag - enables compression if there is no "ETag" header
- auth - enables compression if there is an "Authorization" header
- any - enables compression for all requests
内部代理用户访问图片问题解决
原创
©著作权归作者所有:来自51CTO博客作者lynnteng0的原创作品,请联系作者获取转载授权,否则将追究法律责任
外部网友访问论坛时,所有图片都不显示,提示错误:
[code=CACHE_FILL_OPEN_FILE] An internal error prevented the object from being sent to the client and cached. Try again later.
该网友是集团局域网代理上网,访问其他网站都能够正常,只是我们站图片有问题
公司有一批旧图片是放到windows服务器的
windows服务器上的图片都能够正常访问
最近在做虚拟化,可能是虚拟机的问题?
分别访问虚拟机和物理机上的图片链接,都不行
可以排除这个问题
windows服务器直接用apache提供服务,linux用nginx
那可能是配置的问题
拿一台测试服务器,把线上的nginx配置逐步测试
nginx的基本配置
client_max_body_size 500m;
client_header_buffer_size 256k;
sendfile on;
keepalive_timeout 65;
网友访问正常
加上压缩的配置
gzip on;
gzip_buffers 4 16k;
gzip_comp_level 9;
gzip_min_length 1k;
gzip_proxied any;
gzip_types text/plain application/x-javascript js gzjs text/css text/javascript p_w_picpath/jpeg p_w_picpath/gif p_w_picpath/png;
网友访问出错,提示
[code=CACHE_FILL_OPEN_FILE] An internal error prevented the object from being sent to the client and cached. Try again later.
把上面代理的配置去掉,加上
sendfile on;
keepalive_timeout 300;
fastcgi_buffers 8 256k;
fastcgi_buffer_size 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
访问也正常
因为该网友是内部代理上网,那可能是压缩的代理问题
注释#gzip_proxied any;
重启nginx,访问能够正常
再把线上所有#gzip_proxied any;的配置都注释掉,OK,能够正常访问论坛了
晕,就是这个问题
查看nginx wiki
gzip_proxied:
gzip_proxied any;
一直理解的,应该是“所有的请求都进行压缩”,怎么到了这里,代理的请求被禁止了呢?
真心不明白,难道是nginx的一个bug?
纪录一下
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
问题解决
昨日的问题的一个汇总
赋值 标识符 弱类型 -
Nginx反向代理找不到CSS,JS及图片问题解决
用nginx反向代理后端服务器,打开网页找不到css,js和图片 修改配置如下 location /xxx/ { proxy_pass http://172.16.90
nginx css 反向代理 javascript 重启 -
github 访问慢问题解决
1. 修改本地hosts文件 windows系统的hosts文件的位置如下:C:\Windows\System32\drivers\etc\hostsmac/linux系统的hosts文件的位置如下:/etc/hosts
github .net ip地址 linux系统 windows系统 -
XCopy提示“访问遭到拒绝”问题解决
加上【/r】参数
Windows 技术