小工具知识网

当前位置: 首页 > 行业知识 > nginx the “ssl“ directive is deprecated, use the “listen ... ssl“报错

行业知识

nginx the “ssl“ directive is deprecated, use the “listen ... ssl“报错

2026-11-12 19:01:52 来源:互联网转载

Nginx 配置SSL 证书重载时报错

nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /xxx.conf:31

解决方案 :

listen 443 ssl;

删除或注释 ssl on;

server {   listen 443 ssl; #修改端口号增加ssl   server_name xxxx.cn;    #ssl on; #注释或删除ssl on   ssl_session_timeout 5m;       ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置       ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;#按照这个套件配置       ssl_prefer_server_ciphers on;   #指定PEM格式的证书文件       ssl_certificate     xxxx.pem;       #指定PEM格式的私钥文件      ssl_certificate_key  xxxx.key;   location / {        proxy_set_header Host $host;        proxy_set_header X-Real-IP $remote_addr;        proxy_pass http://127.0.0.1:8088;    # 保留所有请求头字段    proxy_pass_request_headers on;            }}

上一篇:服务器怎么建商店教程?

下一篇:揭秘派派聊天室碎片秘籍,轻松玩转碎片用途,享受全新派聊体验!