LoginSignup
2
3

More than 3 years have passed since last update.

nginx: [warn] the "ssl" directive is deprecated,.... の対処法

Posted at

nginxを更新して nginx -t をした時に nginx: [warn] the "ssl" directive is deprecated,...と表示されて頭を抱えたときの対処法。

結論

落ち着いてエラーメッセージをちゃんと読もう。
ssl on; を消して、Listen のところに書こう。

どうやったらいいの

おそらく設定ファイルがこのようになっているはず。

server {
        listen 443 http2;
        listen [::]:443 http2;
        root /var/www/public_html;
        index index.php index.html index.htm;
        server_name contoso.com;
        ssl on; <-これがだめ
        ssl_certificate      /hoge/nanka;
        ssl_certificate_key  /hoge/huga;
     ...
}

ssl on; と書かれている部分がある。ここを消す。

次に、Listenディレクティブに ssl を足す。

server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        root /var/www/public_html;
        index index.php index.html index.htm;
        server_name contoso.com;
        # ssl on;
        ssl_certificate      /hoge/nanka;
        ssl_certificate_key  /hoge/huga;
     ...
}

これで sudo nginx -t をしてみよう。消えているはず。


$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

くわしくしりたい

nginxのドキュメントに書かれている。 nginx 1.15.0で廃止されたようだ。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3