HTTP variables

$upstream_last_server_name variable (HTTP)

Name of the final selected backend. Useful when setting the expected upstream TLS name in a controlled topology; keep verification enabled. Version: 1.25.3. Commercial subscription; not the HTTP Host field or proof of peer identity. No positional arguments. Example: partial http configuration for a disposable synthetic lab; not a complete deployment.

Formal Syntax & Structure

nginx syntaxnginx
$upstream_last_server_name

Working Example

Example Snippetnginx
# Classify presence without emitting raw backend metadata.map $upstream_last_server_name $lab_seen_upstream_last_server_name {    "" absent;    default present;}
Nginx Reference