HTTP variables
$proxy_port variable (HTTP)
Identifies the configured origin port or the scheme default. It is not the downstream listener port. No positional arguments. Use the example only with a synthetic origin; do not expose internal routing metadata to public clients.
Formal Syntax & Structure
nginx syntaxnginx
$proxy_portWorking Example
Example Snippetnginx
proxy_set_header X-Lab-Origin $proxy_port;