LinuxEye - Linux系统教程

LinuxEye - Linux系统教程

当前位置: 主页 > Linux配置 >

修改nginx配置文件让网页变灰的简便方法

时间:2013-04-22 13:13来源:github 编辑:gist 点击:
# 1. Make sure you have nginx sub module compiled in # nginx -V 21 | grep --color=always \-\-with\-http_sub_module # 2. add two directives below at HTTP level # nginx.conf http { # ...... sub_filter /head style type=text/csshtml { filter:pr
# 1. Make sure you have nginx sub module compiled in
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module'
 
# 2. add two directives below at HTTP level
 
# nginx.conf
http {
# ......
 
sub_filter '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
} img { _filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
} </style>';
sub_filter_once on;
 
# ......
}
 
# 3. nginx -t && /etc/init.d/nginx reload

转载请保留固定链接: http://www.linuxeye.com/configuration/1514.html

------分隔线----------------------------
标签:nginx
评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
  • 高仿皮带
    2017-03-02 12:25:27发表

    工厂代发בּphilipp plein(菲利普普来因) a货专卖店クHACULLA(Haculla) hTTp://T.cN/RiMWyXG

  • 货源网
    2017-03-01 14:29:29发表

    1:1复刻 Crocs(卡骆驰) hTtP://2016.yuandan.ml

栏目列表
推荐内容