Nginx the “ssl“ directive is deprecated, use the “listen ... ssl“

矫情吗;* 2023-10-05 18:09 95阅读 0赞

问题描述

  • 配置Nginx 抛出如下提示信息:

    [warn] 1#1: the “ssl” directive is deprecated, use the “listen … ssl” directive instead in /etc/nginx/conf.d/nginx.conf:22
    2021-01-21T03:02:01.837187000Z nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in /etc/nginx/conf.d/nginx.conf:22

原因

  • 由于新版nginx采用新的方式进行监听https请求,需要修改配置

解决

  • 删除 ssl on,修改listen 443 ssl

    解决前(删除)

    server {

    1. listen 443 ; ssl on; }

    解决后(保留)

    server {

    1. listen 443 ssl ; }

发表评论

表情:
评论列表 (有 0 条评论,95人围观)

还没有评论,来说两句吧...

相关阅读