您的位置:首页 > 其它

内部代理用户访问图片问题解决

2013-01-24 11:43 267 查看
外部网友访问论坛时,所有图片都不显示,提示错误:[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 image/jpeg image/gif image/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 wikigzip_proxied: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
gzip_proxied any;一直理解的,应该是“所有的请求都进行压缩”,怎么到了这里,代理的请求被禁止了呢?
真心不明白,难道是nginx的一个bug?纪录一下

本文出自 “lynnteng0” 博客,请务必保留此出处http://lynnteng0.blog.51cto.com/2145094/1125375
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐