Module variables
The HTTP core module introduces a large set of variables that you can use within the value of directives. Be careful though, as only a handful of directives accept variables in the definition of their value. If you insert a variable in the value of a directive that does not accept variables, no error is reported; instead the variable name appears as raw text.
There are three different kinds of variable that you will come across. The first set represents the values transmitted in the headers of the client request. The second set corresponds to the headers of the response sent to the client. Finally, the third set comprises variables that are completely generated by Nginx.
Request headers
Nginx lets you access client request headers in the form of variables that you will be able to employ later on in the configuration:
Variable | Description |
---|---|
| Value of the Host HTTP header, a string indicating the hostname that the client is trying to reach. |
| Value of the User... |