If you want to use these modules, you must specify the relevant compilation parameters at compile time.
This module can be used to search for and replace text in Nginx answers.
To use this module, you must specify the following compilation parameters at compile time:
--with-http_sub_module option
Sample configuration:
Location/{sub_filter </head> ' </head><script language= ' javascript ' src= ' $script ' ></script> '; Sub_filter_once on;}
Instructions
Sub_filter
Syntax: Sub_filter text substitution
Default value: None
Working with fields: HTTP, server, location
The directive allows you to replace some text in the Nginx answer body to a different value, matching case-insensitive, replacing text with variables, and only one substitution rule in each location.
Sub_filter_once
Syntax: Sub_filter_once on|off
Default value: Sub_filter_once on
Working with fields: HTTP, server, location
Set to OFF replaces all occurrences of the matching field in the answer, and the default only replaces the first occurrence.
Sub_filter_types
Syntax: Sub_filter_types mime-type [Mime-type ...]
Default value: Sub_filter_types HTML
Working with fields: HTTP, server, location
Set Sub_filter Check the MIME type included, default only HTML.