Nginx版本问题导致ssl on配置不能用

in 互联网技术 with 0 comment  访问: 5,996 次

最近把nginx版本从1.12.2升级到了1.15.9然后把所有的站点vhost配置都同步到新版本的Nginx配置文件load加载路径下,然后利用nginx -t检查语法,报错如下:

[root@fsb vhost]# ../../sbin/nginx -t
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/conf/vhost/https-fsb.conf:10
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/conf/vhost/https-fsb.conf:30
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/conf/vhost/https-fsb.conf:57

从上面的警告日志可以看出就是说不支持ssl指令了,让你使用listen ... ssl的方式,为啥不支持了,难道是因为版本升级没有做向前兼容,通过上网搜索在Github(https://github.com/voxpupuli/puppet-nginx/issues/1224)上找到了一些说明, 从链接的信息可以看出就是说从nginx 1.15以及更新的版本,不在支持ssl on;的写法 了。

然后新的写法是listen 443 ssl,修改后重新检查语法一切正常,Nginx也正常启动工作了。

WeZan