HTTP variables

$ssl_protocol variable (HTTP TLS)

Negotiated TLS protocol version. Distinguish actual connection protocol from configured allowed versions and from HTTP version. Version: Introduction not established. 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_protocol

Working Example

Example Snippetnginx
# Partial http-context example: classify synthetic TLS metadata without emitting raw values.map $ssl_protocol $lab_tls_protocol {    TLSv1.3 tls13;    TLSv1.2 tls12;    default other;}
Nginx Reference