ssl_prefer_server_ciphers
The `ssl_prefer_server_ciphers` directive controls the priority of cipher suites used in SSL/TLS connections.
Description
The ssl_prefer_server_ciphers directive in NGINX specifies whether the server's preferred list of cipher suites should take precedence over the client's preferences when establishing SSL/TLS connections. By default, the SSL/TLS handshake process allows the client to select the cipher suite that will be used for securing the connection based on its preferences. However, certain security policies may require the server to have the final say in which cipher suite is actually selected, especially to enforce stronger or more stable encryption methods.
When the directive is set to 'on', NGINX will ignore the client's list of supported cipher suites and will instead select the strongest one from the server's defined list for the connection. If set to 'off', the server will honor the client’s preference, which might result in weaker ciphers being used if the client prefers them. This directive is particularly useful for maintaining control over the security posture of the server by preventing clients from downgrading to less secure cipher suites during the handshake process.
Config Example
ssl_prefer_server_ciphers on;
Ensure your cipher suite list is properly configured; otherwise, it may lead to connection failures if no compatible ciphers are available.
Setting this directive to 'on' may result in clients being unable to connect if they do not support strong ciphers you prefer.