Exploring the variables introduced by the HTTP core module
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 variables 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 ... |