# 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 '' ''; sub_filter_once on; # ...... } # 3. nginx -t && /etc/init.d/nginx reload