Chapter 6
[ 139 ]
variable in
They are also not made for macro expansion in the configuration—they are mostly
used at run time.
The following are the variables and their values defined in the http module:
Table: HTTP variables
Variable Name Value
$arg_name The name argument present in the request
parameters.
$args All of the request parameters.
$binary_remote_addr The client's IP address in binary form (always
4 bytes long).
$content_length The value of the Content-Length request
header.
$content_type The value of the Content-Type request
header.
$cookie_name The cookie labeled name.
$document_root The value of the root or alias directive for
the current request.
$document_uri An alias for $uri.
$host The value of the Host request header,
if present. If this header is not present,
the value is equal to the server_name
matching the request.
$hostname The name of the host where NGINX is
running.
$http_name The value of the name request header.
If this header has dashes, they are converted
to underscores; capital letters to lower case.
$https If the connection was made over SSL, the
value of this variable is on. Otherwise, it's
an empty string.
$is_args If the request has arguments, the value of this
variable is ?. Otherwise, it's an empty string.
$limit_rate The value of the limit_rate directive.
If not set, allows rate limitation to be set
using this variable.
$nginx_version The version of the running nginx binary.