在Nginx负载均衡服务器上,利用sub_filter指令在输出的HTML中增加一行。
就可以实现在IE及IE内核浏览器下,所有网站变灰色。步骤如下:
1、重新编译Nginx,增加http_sub_module模块:
--with-http_sub_module
2、在nginx.conf配置文件的http {...}大括号内增加以下两行:
sub_filter '</head>' '<style type="text/css">html{filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1);-webkit-filter: grayscale(100%); }</style>';
sub_filter_once on;
3、保存后,重新加载配置文件:
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx -s reload
这样,整个页面就都变灰色了。
版权说明:Copyright © 广州松河信息科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州松河信息科技有限公司 版权所有