就可以實現在IE及IE內核瀏覽器下,所有網站變灰色。具體步驟如下:
1、重新編譯Nginx,增加http_sub_module模塊:
tar zxvf nginx-0.8.35.tar.gz
cd nginx-0.8.35
./configure --user=www --group=www --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module
make && make install
pkill -9 nginx
/usr/local/webserver/nginx/sbin/nginx
2、在nginx.conf配置文件的http {...}大括號內增加以下兩行:
sub_filter_once on;
保存後,重新加載配置文件:
/usr/local/webserver/nginx/sbin/nginx -s reload
3、如果某些帶有Flash的頁面仍顯示彩色,或瀏覽器上下滾動條拖動時Flash FLV播放器變花(例如劍網3、劍俠世界官網分流頁),將Flash改爲JS輸出(本例爲SWFObject):
<div id="video_content"></div>
<script type="text/javascript">
<!--
var video_player_so = new SWFObject("http://api.v.xoyo.com/external/player.swf?autostart=true&config=http://api.v.xoyo.com/external/video-542.swf", "sotester", "439", "246", "7");
video_player_so.addParam("wmode", "opaque");
video_player_so.addParam("allowfullscreen","true");
video_player_so.addParam("allowscriptaccess","always");
video_player_so.write("video_content");
//-->
</script>
這樣,整個頁面,包括Flash播放器中的視頻就都變灰色了。