if
Conditionally runs rewrite directives.
| Syntax | if (condition) { ... } |
|---|---|
| Contexts | serverlocation |
Behavior
Conditions include variable truthiness, string comparisons, regular expressions and file tests. Permitted child directives depend on server versus location scope.
Example
if ($request_method = POST) { return 405; }