<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[nginx的Status Code 499是什么错误(Site_access.log)]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 15 Sep 2016 04:45:11 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	背景：发现gitlab经nginx代理后，有一天访问突然发现出现409错误，[15/Sep/2016:12:40:13 +0800] &quot;GET /dashboard/projects HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36&quot;，502 Whoops, GitLab is taking too much time to respond. Try refreshing the page, or going back and attempting the action again.Please contact your GitLab administrator if this problem persists。<br/><br/><br/>我的Web服务器在用的Linx + Mysql + PHP +nginx，今天被DDOS攻击了，观察日志中发现大量的499 Status Code这个错误。GOOGLE了一把才明白这个499的意思：<br/>日志如下:<br/><br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.012 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.015 ut=&quot;-&quot; cs=-<br/>222.215.105.135 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.015 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.002 ut=&quot;-&quot; cs=-<br/>119.147.86.178 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>61.219.178.101 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.002 ut=&quot;-&quot; cs=-<br/>58.49.59.142 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>202.201.252.2 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>202.201.252.2 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>119.147.86.178 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>58.221.37.82 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.039 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.001 ut=&quot;-&quot; cs=-<br/>58.49.59.142 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>58.49.59.142 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.045 ut=&quot;-&quot; cs=-<br/>119.147.86.178 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.036 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.037 ut=&quot;-&quot; cs=-<br/>222.215.105.135 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/><br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.012 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.015 ut=&quot;-&quot; cs=-<br/>222.215.105.135 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.015 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.002 ut=&quot;-&quot; cs=-<br/>119.147.86.178 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>61.219.178.101 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.002 ut=&quot;-&quot; cs=-<br/>58.49.59.142 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>202.201.252.2 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>202.201.252.2 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>119.147.86.178 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>58.221.37.82 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.039 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.001 ut=&quot;-&quot; cs=-<br/>58.49.59.142 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>58.49.59.142 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.045 ut=&quot;-&quot; cs=-<br/>119.147.86.178 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.036 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/>222.189.237.18 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.037 ut=&quot;-&quot; cs=-<br/>222.215.105.135 - - [06/Nov/2011:12:23:27 +0800] &quot;GET / HTTP/1.1&quot; 499 0 &quot;-&quot; &quot;-&quot; &quot;-&quot; rt=0.000 ut=&quot;-&quot; cs=-<br/><br/>400～500间的错误码仅定义到了417，所以499应该是nginx自己定义的。<br/><br/>读读nginx代码，看一下注释，找到src/http/ngx_http_special_response.c 这个文件328行，里面定义了不少http错误码以及相应的返回。注意到有下面这样的注释：<br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_494_page), /* 494, request header too large */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_495_page), /* 495, https certificate error */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_496_page), /* 496, https no certificate */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_497_page), /* 497, http to https */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_404_page), /* 498, canceled */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_null_string,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* 499, client has closed connection */<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_494_page), /* 494, request header too large */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_495_page), /* 495, https certificate error */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_496_page), /* 496, https no certificate */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_497_page), /* 497, http to https */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_string(ngx_http_error_404_page), /* 498, canceled */<br/>&nbsp;&nbsp;&nbsp;&nbsp;ngx_null_string,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* 499, client has closed connection */<br/>可以看到，499对应的是 “client has closed connection”。这很有可能是因为服务器端处理的时间过长，客户端“不耐烦”了。要解决此问题，就需要在程序上面做些优化了。<br/><br/>除了499，nginx还定义了495/496/497/498 这几个Status Codes，相应的意义也在上面的注释中可以看到。开源的东西，可以随时翻看源码，这一点很棒。<br/><br/><br/>来自：http://blog.hexu.org/archives/1085.shtml
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] nginx的Status Code 499是什么错误(Site_access.log)]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>