HTTP variables

$ssl_alpn_protocol variable (HTTP TLS)

Negotiated application protocol, not the complete list advertised by the client. An absent ALPN result is empty. Compare HTTP/1.1 and HTTP/2 clients. Version: 1.21.4. Requires HTTP SSL module and appropriate TLS library. No positional arguments. The example is an http-context map; use only in a disposable TLS lab. A map classification is not authorization.

Formal Syntax & Structure

nginx syntaxnginx
$ssl_alpn_protocol

Working Example

Example Snippetnginx
# Partial http-context example: classify synthetic TLS metadata without emitting raw values.map $ssl_alpn_protocol $lab_tls_alpn_protocol {    h2 http2;    http/1.1 http1;    default other;}
Nginx Reference