Specialist HTTP directives

sub_filter (http-sub)

Replaces matching strings in eligible response bodies.

Formal Syntax & Structure

nginx syntaxnginx
sub_filter string replacement;

Parameters & Attributes

NameTypeDescription
searchstring or expressionMatch text case-insensitively; variables supported since 1.9.4.
replacementstring or expressionSubstitute matched text. This is not a structured HTML parser.

Working Example

Example Snippetnginx
sub_filter "LEARNING_MARKER" "ByteMind";
Nginx Reference