<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[隐藏nginx服务器信息]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[服务器技术]]></category>
<pubDate>Tue, 08 Mar 2011 15:52:03 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	通常nginx服务器不隐藏服务器类型及版本信息<br/><div class="code"><br/>curl -I http://10.60.30.23<br/></div><br/><div class="code"><br/>HTTP/1.1 200 OK<br/>Server: nginx nginx/0.8.53<br/>Date: Tue, 14 Dec 2010 08:10:06 GMT<br/>Content-Type: text/html<br/>Content-Length: 151<br/>Last-Modified: Mon, 13 Dec 2010 09:39:55 GMT<br/>Connection: keep-alive<br/>Accept-Ranges: bytes <br/></div><br/>这对于服务器安全来说是个隐患，用以下方法可以改善这种情况<br/>1. 编辑源代码../src/http/ngx_http_header_filter_module.c<br/>48<br/><div class="code"><br/>static char ngx_http_server_string&#91;&#93; = “Server: nginx” CRLF;<br/>static char ngx_http_server_full_string&#91;&#93; = “Server: ” NGINX_VER CRLF; <br/></div><br/>改为<br/><div class="code"><br/>static char ngx_http_server_string&#91;&#93; = “Server: pws 1.0 ” CRLF;<br/>static char ngx_http_server_full_string&#91;&#93; = “Server: pws 1.0 ” NGINX_VER CRLF; <br/></div><br/>然后编译安装。<br/><br/>2. 编辑/usr/local/nginx/conf/nginx.conf，添加<br/><div class="code"><br/>server_tokens off; <br/></div><br/>重新启动nginx<br/><div class="code"><br/>/usr/local/nginx/sbin/nginx -s reload<br/></div><br/>最终结果如下<br/><div class="code"><br/>curl -I http://10.60.30.23<br/></div><br/><div class="code"><br/>HTTP/1.1 200 OK<br/>Server: pws 1.0<br/>Date: Tue, 14 Dec 2010 08:24:32 GMT<br/>Content-Type: text/html<br/>Content-Length: 151<br/>Last-Modified: Mon, 13 Dec 2010 09:39:55 GMT<br/>Connection: keep-alive<br/>Accept-Ranges: bytes <br/></div><br/>Tags - <a href="http://www.dzhope.com/tags/nginx/" rel="tag">nginx</a> , <a href="http://www.dzhope.com/tags/nginx%25E7%2589%2588%25E6%259C%25AC%25E4%25BF%25A1%25E6%2581%25AF/" rel="tag">nginx版本信息</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] 隐藏nginx服务器信息]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>