Module ngx_http_rewrite_module

The ngx_http_rewrite_module module is used to change request URI using PCRE regular expressions, return redirects, and conditionally select configurations.

The ngx_http_rewrite_module module directives are processed in the following order:

  • the directives of this module specified on the server level are executed sequentially;
  • repeatedly:
    • a location is searched based on a request URI;
    • the directives of this module specified inside the found location are executed sequentially;
    • the loop is repeated if a request URI was rewritten, but not more than 10 times.
break

Syntax: break; Default: — Context: server, location

2017-02-09 07:05:36
rewrite

Syntax: rewrite regex replacement [flag];

2017-02-09 07:08:46
return

Syntax: return code [text];return code

2017-02-09 07:08:46
uninitialized_variable_warn

Syntax: uninitialized_variable_warn on | off; Default: uni

2017-02-09 07:09:47
set

Syntax: set $variable value; Default: —

2017-02-09 07:09:13
rewrite_log

Syntax: rewrite_log on | off; Default: rewrite_log off;

2017-02-09 07:08:47
if

Syntax: if (condition) { ... } Default: — Context:

2017-02-09 07:06:31