ssl_session_ticket_key

The ssl_session_ticket_key directive sets the session ticket key for SSL session resumption in NGINX.

Syntaxssl_session_ticket_key value;
Defaultnone
Contexthttp, server
Arguments1

Description

The ssl_session_ticket_key directive is crucial for enabling and managing SSL session ticket support in NGINX. This directive specifies the key used for encrypting and decrypting session tickets, allowing clients to resume SSL sessions without needing a full handshake. The directive expects a specific key length to ensure security, which should ideally match the encryption algorithm being employed for session tickets. It is important to note that this key should be treated with care and should remain confidential, as disclosure or compromise can lead to security vulnerabilities in SSL session management.

Upon server startup, the key must be generated in a secure manner, and its management is critical. If a server's session ticket key changes, any sessions that were established with the old key will become invalid, resulting in clients being unable to resume those sessions. Therefore, it is recommended to rotate session ticket keys periodically but in a manner that minimizes disruption to clients. The ssl_session_ticket_key directive can be used in both the http and server contexts, making it flexible for use within either scope.

To dynamically set or modify session ticket keys, NGINX allows multiple declarations of this directive with different keys in different contexts, although using the same key across configurations may not be advisable unless strictly controlled. Additionally, a complete restart of the server might be required for the new keys to take effect if they are changed after the server has started.

Config Example

ssl_session_ticket_key /etc/ssl/nginx/ticket.key;

Ensure the key file is kept secure and is not accessible by unauthorized users.

Changing the key will invalidate existing sessions, causing clients to lose session data.

The key must be of a suitable size and format compatible with the server's SSL setting.

← Back to all directives