nginx 定向 http_user_agent 怎么无效啊

2015-07-09 23:46:19 +08:00
 holinhot

location / {
if ($http_user_agent ~* "Windows NT 5.1") {

return 444;

            }
                }

MacBook-Pro:~ louis$ curl -I -A "Windows NT 5.2" hao.123.com/00132233423434
HTTP/1.1 302 Found
Server: gws
Date: Thu, 09 Jul 2015 15:46:07 GMT
Content-Type: text/html
Content-Length: 254
Connection: keep-alive
Keep-Alive: timeout=60
Location: http://hao.123.com/

MacBook-Pro:~ louis$ curl -I -A "Windows NT 5.2" hao.123.com/
HTTP/1.1 200 OK
Server: gws
Date: Thu, 09 Jul 2015 15:47:09 GMT
Content-Type: text/html
Content-Length: 29792
Last-Modified: Thu, 09 Jul 2015 13:20:05 GMT
Connection: keep-alive
Keep-Alive: timeout=60
ETag: "559e7505-7460"
Accept-Ranges: bytes

3252 次点击
所在节点    NGINX
3 条回复
holinhot
2015-07-09 23:55:28 +08:00
不知道刚刚哪弄错了现在又工作了

location / {
if ($http_user_agent ~* "Windows NT 5.2") {

return 444;

}
}
holinhot
2015-07-09 23:57:00 +08:00
无语了 把5.1 xp搞错
holinhot
2015-07-10 00:02:15 +08:00
hehe


242.119.21.11 - - [09/Jul/2015:12:01:20 -0400] "GET /bxiwn.gif HTTP/1.1" 444 0 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; );"
244.229.10.82 - - [09/Jul/2015:12:01:21 -0400] "GET /nrgnpjei.htm HTTP/1.1" 444 0 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; );"

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/204612

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX