nginx 字符串全部替换 sub_filter_once off
nginx 有个字符替换模块, ngx_http_sub_module , 可以对字符进行替换,默认只替换一次。通过设置sub_filter_once off 可以全部替换。
sub_filter_once off
关闭只替换一次。
相关配置
- sub_filter
- sub_filter_last_modified
- sub_filter_once
- sub_filter_types
Sets a string to replace and a replacement string. The string to replace is matched ignoring the case. The string to replace (1.9.4) and replacement string can contain variables. Several
http://nginx.org/en/docs/http/ngx_http_sub_module.html#sub_filtersub_filter
directives can be specified on the same configuration level (1.9.4). These directives are inherited from the previous configuration level if and only if there are nosub_filter
directives defined on the current level.