nginx網頁置灰

我們都經歷過汶川大地震。在地震後有段時間網站都是灰色的,下面是使用nginx的網站的方法:
使用nginx的網站。將網頁製成灰色  使用ub_filter指令在輸出的HTML中增加一行

<style type="text/css">html {filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); }</style>

  就可以實現在IE及IE內核瀏覽器下,所有網站變灰色。具體步驟如下:

  1、重新編譯Nginx,增加http_sub_module模塊:
wget http://nginx.org/download/nginx-0.8.35.tar.gz
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  ''  '';
sub_filter_once on;

  保存後,重新加載配置文件:
/usr/local/webserver/nginx/sbin/nginx -t
/usr/local/webserver/nginx/sbin/nginx -s reload


  3、如果某些帶有Flash的頁面仍顯示彩色,或瀏覽器上下滾動條拖動時Flash FLV播放器變花(例如劍網3、劍俠世界官網分流頁),將Flash改爲JS輸出(本例爲SWFObject):
<script type="text/javascript" src="http://v.xoyo.com/site/v.xoyo.com/web/js/swf.js"></script>
<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播放器中的視頻就都變灰色了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章