大网数据广告活动
服务器运维问答

Setting ssl_prefer_server_ciphers directive in nginx config

· 52CE 我爱测

This question is about setting the correct value of ssl_prefer_server_ciphers while configuring nginx. According to a fairly typical config suggested by Mozilla, the value should be off (source: https://ssl-config.mozilla.org/#se…

问题原文

原帖链接 · Hassan Baig · CC BY-SA 4.0

This question is about setting the correct value of ssl_prefer_server_ciphers while configuring nginx.

According to a fairly typical config suggested by Mozilla, the value should be off (source: https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.7&config=intermediate&openssl-version=1.0.1g).

According to nginx's own documentation, one should always set this to on: https://www.nginx.com/blog/nginx-https-101-ssl-basics-getting-started/ (search the document for ssl_prefer_server_ciphers).

I'm stumped as to which advice to follow. Both sources are pretty solid.

Can some industry experts chime in regarding when one should turn this off, and when on? Would also love to know the rationale.

已采纳解答

原帖链接 · asktyagi · CC BY-SA 4.0

Ok, so there are three categories for choosing this parameter on or off.

**Modern** : Services with clients that support TLS 1.3 and don't need backward compatibility
**Intermediate** : General-purpose servers with a variety of clients, recommended for almost all systems
**Old** : Compatible with a number of very old clients, and should be used only as a last resort

Only situation when you need to put off this parameter is modern configuration where you don't need any backward compatibility, in such cases client will not be able to connect with old ssl/tls except tlsv1.3.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-01-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。