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播放器中的视频就都变灰色了。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章