HTTP variables

$document_root variable (HTTP)

Configured root or alias value for the active request. This is a directory or mapping expression result, not necessarily the complete requested file name. Avoid exposing filesystem paths. Version: Introduction not established. OSS documentation; verify build. No positional directive arguments. Example is a partial configuration fragment for a disposable synthetic lab; not a production logging policy.

Formal Syntax & Structure

nginx syntaxnginx
$document_root

Working Example

Example Snippetnginx
# Partial http-context example: map a synthetic value to a presence flag, never log the raw value.map $document_root $lab_present {    "" 0;    default 1;}
Nginx Reference