<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[张宴的博客]]></title> 
<link>http://zyan.cc/index.php</link> 
<description><![CDATA[Web系统架构与底层研发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[张宴的博客]]></copyright>
<item>
<link>http://zyan.cc/post/441/</link>
<title><![CDATA[通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>张宴 &lt;net@s135.com&gt;</author>
<category><![CDATA[Web服务器]]></category>
<pubDate>Tue, 20 Apr 2010 07:52:56 +0000</pubDate> 
<guid>http://zyan.cc/post/441/</guid> 
<description>
<![CDATA[ 
	<div class="quote"><div class="quote-title">引用</div><div class="quote-content">　　新华网北京4月20日电 国务院决定，为表达全国各族人民对青海玉树地震遇难同胞的深切哀悼，2010年4月21日举行全国哀悼活动，全国和驻外使领馆下半旗志哀，停止公共娱乐活动。</div></div><br/>　　4月21日全国哀悼日，将去除网站全站所有站点色彩（变灰），悼念遇难同胞，愿死者安息。<br/><br/>　　金山逍遥网旗下站点众多，虽然官网都有统一的页头、页尾，但是，还有一部分站点（例如用户中心、注册充值页面、游戏客户端内嵌网站、活动专题页等）页头、页尾不相同。但是，所有站点采用的都是Nginx服务器，95%以上的站点都经过Nginx负载均衡服务器，因此只需要在Nginx负载均衡服务器上，利用sub_filter指令在输出的HTML中增加一行：<br/><br/><div style="border-left: 0px dashed #D6C094; margin: 5px; padding: 3px; margin-bottom:0px; border: 1px dashed #00a0c6; background-color: #ffffff;">&lt;style type=&quot;text/css&quot;&gt;html &#123;filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); &#125;&lt;/style&gt;</div><br/><br/>　　就可以实现在IE及IE内核浏览器下，所有网站变灰色。步骤如下：<br/><br/>　　1、重新编译Nginx，增加http_sub_module模块：<br/><div style="border-left: 0px dashed #D6C094; margin: 5px; padding: 3px; margin-bottom:0px; border: 1px dashed #00a0c6; background-color: #ffffff;">wget <a href="http://nginx.org/download/nginx-0.8.35.tar.gz" target="_blank">http://nginx.org/download/nginx-0.8.35.tar.gz</a><br/>tar zxvf nginx-0.8.35.tar.gz<br/>cd nginx-0.8.35<br/>./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module<br/>make && make install<br/>pkill -9 nginx<br/>/usr/local/webserver/nginx/sbin/nginx</div><br/><hr/><br/>　　2、在nginx.conf配置文件的http &#123;...&#125;大括号内增加以下两行：<br/><div style="border-left: 0px dashed #D6C094; margin: 5px; padding: 3px; margin-bottom:0px; border: 1px dashed #00a0c6; background-color: #ffffff;">sub_filter&nbsp;&nbsp;'&lt;/head&gt;'&nbsp;&nbsp;'&lt;style type=&quot;text/css&quot;&gt;html &#123;filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); &#125;&lt;/style&gt;&lt;/head&gt;';<br/>sub_filter_once on;</div><br/><br/>　　保存后，重新加载配置文件：<br/><div style="border-left: 0px dashed #D6C094; margin: 5px; padding: 3px; margin-bottom:0px; border: 1px dashed #00a0c6; background-color: #ffffff;">/usr/local/webserver/nginx/sbin/nginx -t<br/>/usr/local/webserver/nginx/sbin/nginx -s reload</div><br/><hr/><br/>　　3、如果某些带有Flash的页面仍显示彩色，或浏览器上下滚动条拖动时Flash FLV播放器变花（例如剑网3、剑侠世界官网分流页），将Flash改为JS输出（本例为SWFObject）：<br/><div class="code">&lt;script type=&quot;text/javascript&quot; src=&quot;http://v.xoyo.com/site/v.xoyo.com/web/js/swf.js&quot;&gt;&lt;/script&gt;<br/>&lt;div id=&quot;video_content&quot;&gt;&lt;/div&gt;<br/>&lt;script type=&quot;text/javascript&quot;&gt; <br/>&lt;!--<br/>&nbsp;&nbsp;&nbsp;&nbsp;var video_player_so = new SWFObject(&quot;http://api.v.xoyo.com/external/player.swf?autostart=true&amp;config=http://api.v.xoyo.com/external/video-542.swf&quot;, &quot;sotester&quot;, &quot;439&quot;, &quot;246&quot;, &quot;7&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;video_player_so.addParam(&quot;wmode&quot;, &quot;opaque&quot;); <br/>&nbsp;&nbsp;&nbsp;&nbsp;video_player_so.addParam(&quot;allowfullscreen&quot;,&quot;true&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;video_player_so.addParam(&quot;allowscriptaccess&quot;,&quot;always&quot;);<br/>&nbsp;&nbsp;&nbsp;&nbsp;video_player_so.write(&quot;video_content&quot;);<br/>//--&gt;<br/>&lt;/script&gt;</div><br/><br/>　　这样，整个页面，包括Flash播放器中的视频就都变灰色了。<br/><br/>............<br/><br/>Tags - <a href="http://zyan.cc/tags/nginx/" rel="tag">nginx</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5676</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>allan &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 08:15:31 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5676</guid> 
<description>
<![CDATA[ 
	加了一层膜而已,firefox不生效。。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5677</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>xiaog &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 08:27:04 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5677</guid> 
<description>
<![CDATA[ 
	不知道，firefox、chrome应该悲哀，还是ie应该悲哀.
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5679</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>直来直往 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 09:20:21 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5679</guid> 
<description>
<![CDATA[ 
	及时
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5680</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>三皮 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 09:38:44 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5680</guid> 
<description>
<![CDATA[ 
	唉，记得08年，5.12的时候用过，想不到今年又要拿来用了。<br/><br/>希望以后再也不要用到。。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5684</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>213 &lt;ksmwly@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 11:00:48 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5684</guid> 
<description>
<![CDATA[ 
	我的以变了。<a href="http://www.36dj.com" target="_blank">http://www.36dj.com</a>
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5686</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>tao &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 11:06:03 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5686</guid> 
<description>
<![CDATA[ 
	请教三台webserver 用nginx为一flash 游戏做均衡<br/>第一次加载flash HTTP状态260 下载停止<br/>该问题的出现可能在哪里里
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5687</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>liruqi &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 12:50:06 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5687</guid> 
<description>
<![CDATA[ 
	这种哄小孩的东西，支持ie就够了
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5688</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>qwe &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 13:48:00 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5688</guid> 
<description>
<![CDATA[ 
	经测试成功，thanks<br/><br/>顺便问下张哥：<br/><br/>listen&nbsp;&nbsp;80;<br/>&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;status.blog.s135.com;<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;location / &#123;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//这句话意思在/目录下么？ 难道我设置问题？<br/>&nbsp;&nbsp;&nbsp;&nbsp;stub_status on;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp;&nbsp;&nbsp;access_log&nbsp;&nbsp; off;<br/>请问各位，我这个监控一直不能用，我查找了各种方法还是没能实现，首先编译是一起编译了的（刚才我用这个主题重新搞了一下还是不行）<br/>我没有建立其他目录了，只有blog和www，是不是我这个&nbsp;&nbsp;location / 应该设置到哪个目录阿？<br/>stub_status这个选项在那个文件里面开启关闭的？<br/><br/>而且我也买了rashost的vps搭建方法同上，发现我不怎么编辑网站内容的话运行还算正常，但是我用DZ后台管理软件管理，开putty管理vps就发现很容易vps内存就没有了，死机显现很严重。不知道如何管理优化这个服务？有没有相关思路谢谢<br/><br/>我开启了blog ww两个目录。我再www目录写了个简单的php 301重定向，可以实现www.***.com转移到blog目录，但是域名***.com默认就是blog目录我感觉好奇怪。在那里配置？我一直没找到。我编辑conf文件添加了***.com在www.***.com后面可还是没实现。<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;server_name&nbsp;&nbsp;<a href="http://www.s135.com" target="_blank">www.s135.com</a> s135.com;<br/>&nbsp;&nbsp;&nbsp;&nbsp;index index.html index.htm index.php;<br/>&nbsp;&nbsp;&nbsp;&nbsp;root&nbsp;&nbsp;/data0/htdocs/www;<br/><br/>ps：请问vps 128内存的，一般支持多少人在线没问题阿？256的呢？ 512的呢？<br/>别突然流量高了就挂了。呵呵
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5689</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>无喱头 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 14:23:04 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5689</guid> 
<description>
<![CDATA[ 
	不错，<a href="http://www.dlapk.com" target="_blank">安致资源站</a> 已经置灰。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5692</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>哈哈大侠 &lt;2001_jinge@163.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 17:35:17 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5692</guid> 
<description>
<![CDATA[ 
	我的<a href="http://www.x2009.cn" target="_blank">电脑知识</a>网站也黑白了。用的也是滤镜。
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5693</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>cjfsir &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Tue, 20 Apr 2010 23:31:45 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5693</guid> 
<description>
<![CDATA[ 
	如果仅让变IE变灰，不用那么复杂，&lt;style&gt;html&#123;filter:gray;&#125;&lt;/style&gt; 这一句就够了。偷新浪的，呵呵
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5694</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>lionkg &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 21 Apr 2010 00:21:10 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5694</guid> 
<description>
<![CDATA[ 
	好像对discuz7.2没作用？？？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5695</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>小菜鸟 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 21 Apr 2010 01:38:29 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5695</guid> 
<description>
<![CDATA[ 
	其它的门户网站，在ff下是怎么实现的，期待中……
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5696</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>54chen &lt;czhttp@gmail.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 21 Apr 2010 02:01:21 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5696</guid> 
<description>
<![CDATA[ 
	sub_files会打乱DOCTYPE的声明吗？
]]>
</description>
</item><item>
<link>http://zyan.cc/post/441/#blogcomment5697</link>
<title><![CDATA[[评论] 通过Nginx使全站页面变灰，哀悼玉树地震遇难者]]></title> 
<author>wwek &lt;licoolgo@qq.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Wed, 21 Apr 2010 02:07:30 +0000</pubDate> 
<guid>http://zyan.cc/post/441/#blogcomment5697</guid> 
<description>
<![CDATA[ 
	不错~~~~~~~·<br/>对于单个服务器改css html来的简单。 对于张大侠这种环境，利用nginx特性来做非常棒·
]]>
</description>
</item>
</channel>
</rss>