前言
- CentOS Linux release 8.2.2004 (Core)
- phpstdy X1.26
- nginx1.15
错误内容
nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in /usr/local/phpstudy/vhost/nginx/1xxx.com_80.conf:6
分析
http://nginx.org/en/docs/mail/ngx_mail_ssl_module.html#ssl
This directive was made obsolete in version 1.15.0. The ssl parameter of the listen directive should be used instead.
解决办法
- 删除
ssl on;
指令 - 在
listen
指令中添加 ssl 参数
server{
listen 80 ;
listen 443 default ssl;
server_name xxx.com ;
ssl_certificate /usr/local/phpstudy/vhost/nginx/ssl/20210709_xxx.com.pem;
ssl_certificate_key /usr/local/phpstudy/vhost/nginx/ssl/20210709_xxx.com.key;
...
}