$ssl_client_v_start

$ssl_client_v_start returns the timestamp when the SSL handshake is completed and the client connection is established. — NGINX Core (HTTP)

$ssl_client_v_start NGINX Core (HTTP)

Description

The $ssl_client_v_start variable is part of NGINX's support for SSL/TLS and is particularly useful for logging and debugging purposes. It captures the starting time of the SSL handshake, more precisely when the SSL connection is fully established between the client and the server. This timestamp is expressed in seconds since the epoch (January 1, 1970). This variable becomes available once an SSL connection has been established during the request processing. The value of $ssl_client_v_start is accessed within the context of a request, allowing NGINX to log the precise moment this event occurs. Knowing the start time of the SSL connection can assist developers and system administrators in performance monitoring, as it helps in understanding the duration of SSL handshakes and troubleshooting any related latency issues. Typical values for this variable will format as UNIX timestamps, such as '1672531199'.

Config Example

server {
    listen 443 ssl;
    server_name example.com;

    ssl_certificate /etc/ssl/certs/example.com.crt;
    ssl_certificate_key /etc/ssl/private/example.com.key;

    access_log /var/log/nginx/access.log combined;

    location / {
        add_header X-SSL-Client-V-Start "$ssl_client_v_start";
    }
}

Subsystem

http

Cacheable

Yes

Contexts

http, server, location, if

The variable is only available in the context of an SSL-enabled request. Make sure that SSL is configured and enabled for the server block.

If the connection fails before the SSL handshake completes, this variable will not be set.