<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>https://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>https://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]Nginx关闭Etags的方法，关闭 if_modified_since off;的方法。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Unix/LinuxC技术]]></category>
<pubDate>Wed, 18 Sep 2019 02:34:35 +0000</pubDate> 
<guid>https://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	/usr/local/nginx/conf/vhosts/yum.qr.cntv.net.conf<br/><br/><textarea name="code" class="php" rows="15" cols="100">
server&#123;
&nbsp;&nbsp;&nbsp;&nbsp;listen 80;
&nbsp;&nbsp;&nbsp;&nbsp;server_name yum.qr.cntv.net;
&nbsp;&nbsp;&nbsp;&nbsp;index index.html index.htm index.php;
&nbsp;&nbsp;&nbsp;&nbsp;root /data/www/yum.qr.cntv.net;
&nbsp;&nbsp;&nbsp;&nbsp;autoindex on;
&nbsp;&nbsp;&nbsp;&nbsp;autoindex_exact_size off;
&nbsp;&nbsp;&nbsp;&nbsp;autoindex_localtime on;
&nbsp;&nbsp;&nbsp;&nbsp;etag off;

&nbsp;&nbsp;&nbsp;&nbsp;location = / &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#etag off;&nbsp;&nbsp;&nbsp;&nbsp;#放这儿不行&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;autoindex on;
&nbsp;&nbsp;&nbsp;&nbsp;&#125;

&nbsp;&nbsp;&nbsp;&nbsp;access_log on;
&nbsp;&nbsp;&nbsp;&nbsp;access_log /data/logs/nginx/yum_access.log main;
&nbsp;&nbsp;&nbsp;&nbsp;error_log /data/logs/nginx/yum_error.log warn;

&#125;
</textarea><br/><br/>关闭前：<br/>Connection: keep-alive<br/>Content-Encoding: gzip<br/>Content-Type: text/xml<br/>Date: Wed, 18 Sep 2019 02:23:28 GMT<br/>ETag: W/&quot;5d80ad08-bb9&quot; 【】<br/>ip_network: 234.253<br/>Last-Modified: Tue, 17 Sep 2019 09:53:12 GMT<br/>Server: nginx<br/>Transfer-Encoding: chunked<br/>Vary: Accept-Encoding<br/><br/>关闭后：<br/>http://yum.qr.cntv.net/centos/6/x86_64/repodata/repomd.xml<br/>Connection: keep-alive<br/>Content-Encoding: gzip<br/>Content-Type: text/xml<br/>Date: Wed, 18 Sep 2019 02:18:51 GMT<br/>ip_network: 234.254<br/>Last-Modified: Tue, 17 Sep 2019 09:53:12 GMT<br/>Server: nginx<br/>Transfer-Encoding: chunked<br/>Vary: Accept-Encoding<br/><br/><br/>来自：http://nginx.org/en/docs/http/ngx_http_core_module.html<br/>Syntax:&nbsp;&nbsp;etag on &#124; off;<br/>Default:&nbsp;&nbsp;<br/>etag on;<br/>Context:&nbsp;&nbsp;http, server, location<br/>This directive appeared in version 1.3.3.<br/><br/><br/>二）关闭 if_modified_since off;的方法。<br/>默认是开启的<br/><br/>可以参考两个方案(实践没有成功)<br/><br/>第一在nginx.conf里设置<br/><br/>if_modified_since off&#124;on;<br/>第二在具体的location段里<br/><br/>location ~* &#92;.(?:manifest&#124;appcache&#124;html?&#124;xml&#124;json)$ &#123;<br/> # add_header&nbsp;&nbsp;Last-Modified $date_gmt;<br/>&nbsp;&nbsp;# add_header&nbsp;&nbsp;Last-Modified &quot;&quot;; #不想要就置空<br/> # add_header&nbsp;&nbsp;Cache-Control &quot;public&quot;;<br/>&#125;<br/>PS:$date_gmt是内嵌变量，具体参考ngx_http_ssi_module模块<br/><br/>nginx如果打开了SSI模块，会默认关闭header中的last-modified输出<br/>https://blog.csdn.net/weixin_34168700/article/details/92438695<br/>
]]>
</description>
</item><item>
<link>https://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]Nginx关闭Etags的方法，关闭 if_modified_since off;的方法。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>