一个十分诡异的nginx问题

hb_fukua 发布于 2011/06/17 09:34
阅读 1K+
收藏 0

我们网站的架构是ngixn+apache(解析php),昨天发生了个诡异的事情,测试的时候在满足了4个条件后产生的,ie浏览器访问 nginx上的swf资源的时候,ie发出的报文显示浏览器语言为zh-CN,(我们网站的nginx有这么一条规则如果浏览器的语言为中文,则返回505错误),导致获取资源失败,但是访问其他类型资源或者用其他浏览器时候都能成功访问网站的swf资源,操作系统是英文的xp。哪位大哥知道这可能是什么回事么?

下面把我抓包的报文贴出来

成功获取时候的报文:

GET /special/video/images/demo.swf HTTP/1.1
Host: 192.168.1.101
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive

 

HTTP/1.1 200 OK
Server: nginx/1.0.4
Date: Thu, 16 Jun 2011 08:41:32 GMT
Content-Type: application/x-shockwave-flash
Content-Length: 190177
Last-Modified: Tue, 14 Jun 2011 08:02:46 GMT
Connection: keep-alive
Accept-Ranges: bytes

!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
  <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
  %brandDTD;
  %sanitizeDTD;
]>

 

失败时候的报文:

GET /special/video/images/demo.swf HTTP/1.1
Accept: */*
User-Agent: contype
Host: 192.168.1.101
Cookie: ZDEDebuggerPresent=php,phtml,php3

 

HTTP/1.1 200 OK
Server: nginx/1.0.4
Date: Thu, 16 Jun 2011 08:03:27 GMT
Content-Type: application/x-shockwave-flash
Connection: keep-alive
Last-Modified: Wed, 15 Jun 2011 03:34:37 GMT
ETag: "8c1136-2e6e1-4a5b7d4f0ed40"
Accept-Ranges: bytes
Content-Length: 190177

CWS剦


GET /special/video/images/demo.swf HTTP/1.1
Accept: */*
Accept-Language: zh-CN
Referer: http://192.168.1.101/special/video/images/demo.swf
x-flash-version: 10,3,181,26
Accept-Encoding: gzip, deflate
Range: bytes=0-
Unless-Modified-Since: Wed, 15 Jun 2011 03:34:37 GMT
If-Range: "8c1136-2e6e1-4a5b7d4f0ed40"
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
Host: 192.168.1.101
Connection: Keep-Alive
Cookie: ZDEDebuggerPresent=php,phtml,php3

 


HTTP/1.1 200 OK
Server: nginx/1.0.4
Date: Thu, 16 Jun 2011 08:03:27 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
X-Powered-By: PHP/5.2.6
Set-Cookie: ZDEDebuggerPresent=php,phtml,php3; path=/
Set-Cookie: wholesale=1308211406; expires=Fri, 15-Jun-2012 08:03:26 GMT
Content-Length: 440

<H1>Internal Server Error 505</H1>The server encountered an internal error

 

补充:

如果将不能访问的swf文件改个名字,则第一次时候ie能访问成功改名后的swf文件,之后就又不能访问了,第一次发出报文语言为en-us,之后都为zh-CN,这真是太奇怪了吧

求指导

 

 

 

 

加载中
0
pizigou
pizigou
我大致看了下,貌似跟NGINX无关,是你浏览器识别编码上有问题?第一会识别出en-us,第二次就会成为zh-cn。并且你其他浏览器访问正常,就证明了这一点。
0
hb_fukua
hb_fukua

和nginx有关系的,因为swf资源是apache转发给ng的,用ie直接访问apache上的swf是可以的,但通过ng就不可以了,很想不通啊

0
yak
yak
apache 就可以,nginx不行
返回顶部
顶部