给nginx配置https时报错:

the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in "nginx.conf:44" 

问题原因

nginx新版本修改了ssl的配置方式,老的ssl on语法已经不推荐使用,建议使用以下形式开启ssl:

listen 443 ssl;

ssl_certificate xx.crt;
ssl_certificate_key xx.key;

低版本nginx开启ssl指令:

ssl on;
ssl_certificate xx.crt;
ssl_certificate_key xx.key;
最后修改:2020 年 03 月 22 日
如果觉得我的文章对你有用,请随意赞赏