The?ngx_http_sub_module?module is a filter that modifies a response by replacing one specified string by another.
就是把網(wǎng)頁(yè)中的字符串進(jìn)行替換 比如t替換成T
Example Configuration

Directives
Syntax:sub_filter?string?replacement;
Default:—
Context:http,?server,?location
string? 為所需要替換的字符串,replacement為要替換成的字符,注意使用單引號(hào)
Syntax:sub_filter_last_modified?on?|?off;
Default:sub_filter_last_modified off;
Context:http,?server,?location
就是用于設(shè)置網(wǎng)頁(yè)內(nèi)替換后是否修改 可在nginx.conf的 http, server, location三個(gè)位置配置使 用,默認(rèn)值是off
Syntax:sub_filter_once?on?|?off;
Default: sub_filter_once on;
Context:http,?server,?location
控制匹配個(gè)數(shù),如果是on 則只匹配第一個(gè),如果off則全部匹配
Syntax:sub_filter_types?mime-type?...;
Default: sub_filter_types text/html;
Context:http,?server,?location
用于指定替換sub_filter的類(lèi)型,默認(rèn)為text/html.