Subs#
The Subs module allows for the replacement of strings in the body of HTTP responses (both fixed and using regular expressions). All occurrences found in the response body are replaced. To install the module, use one of the following packages: Angie: Angie PRO: To include the module in the context of Detailed documentation and source code are available at:
yaoweibin/ngx_http_substitutions_filter_moduleInstallation#
angie-module-subs
angie-pro-module-subs
Loading the Module#
main{}
:load_module modules/ngx_http_subs_filter_module.so;
Configuration Example#
http {
server {
listen 80;
location / {
subs_filter_types text/html text/css text/xml;
subs_filter st(\d*).example.com $1.example.com ir;
subs_filter a.example.com s.example.com;
subs_filter http://$host https://$host;
}
}
}
Additional Information#