HTTP variables

$hostname variable (HTTP)

Host name of the machine running Nginx. Useful in synthetic instance diagnostics; avoid exposing infrastructure identity publicly. 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
$hostname

Working Example

Example Snippetnginx
# Partial http-context example: isolated synthetic requests only; no real user data.log_format lab_hostname escape=json '{"observed":"$hostname"}';
Nginx Reference