解决Nginx升级到1.15.x报SSL警告
作为一个习惯追新的人,最近把nginx升级到了1.15.2,修改站点配置并重新加载配置文件时,发现报警告。
虽然不影响正常,也不是处女座,但还是看不顺眼,经过一番百度 Google,终于找到原因和解决方法!
报错内容
nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /usr/local/nginx/conf/vhost/test.ll00.cn:24
原因
新版本不推荐使用ssl指令,所以会发出一段警告。使用listen 443 ssl;
代替
解决方法
在配置文件里,找到ssl on;
,将其注释掉
# ssl on;
然后修改监听端口处的配置后面加上ssl
listen 443 ssl;
相关Nginx更新日志:
Changes with nginx 1.15.0 05 Jun 2018
*) Change: the "ssl" directive is deprecated; the "ssl" parameter of the
"listen" directive should be used instead.
*) Change: now nginx detects missing SSL certificates during
configuration testing when using the "ssl" parameter of the "listen"
directive.
*) Feature: now the stream module can handle multiple incoming UDP
datagrams from a client within a single session.
*) Bugfix: it was possible to specify an incorrect response code in the
"proxy_cache_valid" directive.
*) Bugfix: nginx could not be built by gcc 8.1.
*) Bugfix: logging to syslog stopped on local IP address changes.
*) Bugfix: nginx could not be built by clang with CUDA SDK installed;
the bug had appeared in 1.13.8.
*) Bugfix: "getsockopt(TCP_FASTOPEN) ... failed" messages might appear
in logs during binary upgrade when using unix domain listen sockets
on FreeBSD.
*) Bugfix: nginx could not be built on Fedora 28 Linux.
*) Bugfix: request processing rate might exceed configured rate when
using the "limit_req" directive.
*) Bugfix: in handling of client addresses when using unix domain listen
sockets to work with datagrams on Linux.
*) Bugfix: in memory allocation error handling.