Nginx模块——ngx_http_sub_module

The ngx_http_sub_module module is a filter that modifies a response by replacing one specified string by another.

就是把网页中的字符串进行替换 比如t替换成T

Example Configuration


configuration

Directives

Syntax:sub_filter string replacement;

Default:—

Context:http, server, location

string  为所需要替换的字符串,replacement为要替换成的字符,注意使用单引号

Syntax:sub_filter_last_modified on | off;

Default:sub_filter_last_modified off;

Context:http, server, location

就是用于设置网页内替换后是否修改 可在nginx.conf的 http, server, location三个位置配置使 用,默认值是off

Syntax:sub_filter_once on | off;

Default: sub_filter_once on;

Context:http, server, location

控制匹配个数,如果是on 则只匹配第一个,如果off则全部匹配

Syntax:sub_filter_types mime-type ...;

Default: sub_filter_types text/html;

Context:http, server, location

用于指定替换sub_filter的类型,默认为text/html.

你可能感兴趣的:(Nginx模块——ngx_http_sub_module)