【Nginx-异常】nginx报错 the "ssl" directive is deprecated, use the "listen ... ssl" 2020年10月25日 ssl linux nginx 今天给博客设置了https的配置,但是启动的时候报错 > 下面是详细的报错 ``` [root@zw conf.d]# nginx -t nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/default.conf:21 nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful ``` `ssl` 不建议作为一个指令使用,而只是 `listen` 指令的一个参数。 ## 解决办法 使用`listen 443 ssl` ,删除 `ssl on` 就行了。 改成 ``` server { listen 443 ssl; ..... } ``` ## 参考 [nginx报错 the "ssl" directive is deprecated, use the "listen ... ssl"](https://blog.csdn.net/fengqiaoguke/article/details/100011255)