Skip to content

Instantly share code, notes, and snippets.

@sivagao
sivagao / nginx.conf
Last active December 16, 2015 11:29 — forked from hydra35/nginx.conf
灰掉,灰掉... Cross-Browser Grayscale with CSS
# 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%); } img { _filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0); -webkit-filter: grayscale(100%); } </style>';