A collection of extra variables for NGINX. Used to meet logging or other needs.
original request path (without arguments).
original request arguments.
“?” if original request uri has arguments, or an empty string otherwise.
"&" if original request uri has arguments, or "?" otherwise.
full current uri (with arguments), normalized.
the value of $current_uri may change during request processing, e.g. when doing internal redirects, or when using index files.
current path (without arguments), normalized.
the value of $current_path is the same as $uri. it may change during request processing, e.g. when doing internal redirects, or when using index files.
full current uri in request (with arguments), normalized and escaped again.
the value of $escaped_current_uri may change during request processing, e.g. when doing internal redirects, or when using index files.
current path in request (without arguments), normalized and escaped again.
the value of $normalized_current_uri_path may change during request processing, e.g. when doing internal redirects, or when using index files.
"&" if a request line has arguments, or "?" otherwise.
a literal dollar sign.
current time in seconds.
the extension from $uri.
"1" if the current request is an "internal request", i.e., a request initiated from inside the current Nginx server instead of from the client side, or "0" otherwise.
"1" if the current request is an Nginx subrequest, or "0" otherwise.
the name of the current location block.
the number of times the current request has been internally.
the number of subrequests performed for this request.
connection established timestamp in seconds with the milliseconds resolution.
ssl handshake start timestamp in seconds with the milliseconds resolution.
ssl handshake finish timestamp in seconds with the milliseconds resolution.
keeps time spent on ssl handshaking in seconds with the milliseconds resolution.
request created timestamp in seconds with the milliseconds resolution.
response header sent timestamp in seconds with the milliseconds resolution.
keeps time spent on handling request internally from receiving the request to sending the response header to the client.
keeps time spent on sending the response body to the client.
Uppercase host name.
Lowercase host name.
local time in the rfc 1123 standard format. the time format is consistent with the http Date
header.
the cache file path for a cached.
The following is some timestamp calculation logic. The variables calculated using $msec have accurate values only when used in the access logs. Their values may not be accurate if used outside the log phase.
- $connection_time = $msec - $connection_established_ts (connections may be reused)
- $ssl_handshake_time = $ssl_handshake_end_ts - $ssl_handshake_start_ts
- $request_handling_time = $response_header_sent_ts - $request_created_ts
- $response_body_time = $msec - $response_header_sent_ts
- $request_time = $msec - $request_created_ts