Nginx replace text module Substitution

  

This module can search and replace text in nginx response. To use this module you must specify the following compilation parameters at compile time:
location /{ sub_filter </head> '</head><script language="javascript
" src=" ;$script"></script>'; sub_filter_once on;}

Instruction sub_filter Syntax: sub_filter text substitution Default value: none Use field: http, server, location directive allows to replace some text in nginx response body to For other values, the match is not case sensitive, the replacement text can contain variables, and only one replacement rule can be specified in each location. Sub_filter_once syntax: sub_filter_once on| Off default value: sub_filter_once on use field: http, server, location set to off will replace all matching fields that appear in the response, the default will only replace the first occurrence of the matching value. Sub_filter_types Syntax: sub_filter_types mime-type [mime-type …] Default: sub_filter_types text/html Use fields: http, server, location Set sub_filter to check the included MIME type, the default is only text/html.

Copyright © Windows knowledge All Rights Reserved