“nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in example.com.nginx.ssl.conf“ これは、古い nginx 構成または VestaCP を使用する Web サーバーでよく発生するアラートです。
コンテンツ
nginx -t

この警告は、数年前に VestaCP がインストールされているサーバーの構成で最も頻繁に表示されます。 nginx 指令は必要だった “ssl on“。
修正方法 “SSL” ディレクティブは廃止されました Nginx / VestaCP で
方法 1. ドメインの nginx.conf ファイルを編集する
最も簡単な方法は、# を使用してディレクティブをキャンセルすることです。 “SSLオン” nginx が警告するドメインの場合。
sudo nano /home/vestacpuser/conf/web/example.com.nginx.ssl.conf
# ssl on

ファイルを保存してから再度実行します nginx -t。エラー nginx: [warn] the “ssl” directive is deprecated…” もう存在しなくなります。
nginx -t
この方法では、エラーが完全に解決されるわけではありません。新しいドメインは、VestaCP 上のアカウントに割り当てられたパッケージの構成ファイルを尊重します。
方法2.編集 VestaCP Web Template Nginxの場合。
追加する前に ユーザー で vestacp、パッケージを作成する必要があります。 VestaCP Packages。これらのパッケージには、さまざまな CMS またはスクリプト用のいくつかの設定が含まれています。 Web Template (Nginx), Backend Template (PHP-FPM), DNS Template (NAMED).
を追加すると、 分野 1つ ユーザー VestaCP、新しく追加されたドメインのデフォルトの Nginx 構成は次のようになります。 Web Template (Nginx) 選択済み ユーザーパッケージの場合の

を追加するシナリオを考えます。 Vesta Package Name: Stealth cu Web Template NGINX: wordpress2。テンプレートの場合 “wordpress2” ディレクティブが含まれています “ssl on”、このテンプレートで追加された新しいドメインには、この古いディレクティブが設定されます。だからそれが一番 変更します Web Template で vestacp。したがって、追加された新しいドメインは受信できなくなります “SSLオン” Nginx 構成内。
出版当時 Web Template VestaCP 排除する “ssl” directive is deprecated” ?
追加されたドメインの構成ファイルを記述するテンプレートは、次の場所にあります。
/usr/local/vesta/data/templates/web/nginx/php-fpm
これらには2つのエンディングがあります。 .tpl のために SSLを使用しないドメイン そして 。stpl のために SSL が有効になっているドメイン。
[root@north php-fpm]# pwd
/usr/local/vesta/data/templates/web/nginx/php-fpm
[root@north php-fpm]# ls -all
total 224
drwxr-xr-x 2 root root 4096 Jul 3 23:51 .
drwxr-xr-x 3 root root 4096 Apr 25 2017 ..
-rwxr-xr-x 1 root root 1737 Feb 27 07:12 cms_made_simple.stpl
-rwxr-xr-x 1 root root 1638 Feb 27 07:12 cms_made_simple.tpl
-rwxr-xr-x 1 root root 1770 Feb 27 07:12 codeigniter2.stpl
-rwxr-xr-x 1 root root 1671 Feb 27 07:12 codeigniter2.tpl
-rwxr-xr-x 1 root root 6528 Feb 27 07:12 datalife_engine.stpl
-rwxr-xr-x 1 root root 6429 Feb 27 07:12 datalife_engine.tpl
-rwxr-xr-x 1 root root 1601 Feb 27 07:12 default.stpl
-rwxr-xr-x 1 root root 1502 Feb 27 07:12 default.tpl
-rwxr-xr-x 1 root root 2176 Feb 27 07:12 dokuwiki.stpl
-rwxr-xr-x 1 root root 2076 Feb 27 07:12 dokuwiki.tpl
-rwxr-xr-x 1 root root 2280 Feb 27 07:12 drupal6.stpl
-rwxr-xr-x 1 root root 2177 Feb 27 07:12 drupal6.tpl
-rwxr-xr-x 1 root root 2508 Feb 27 07:12 drupal8.stpl
-rwxr-xr-x 1 root root 2415 Feb 27 07:12 drupal8.tpl
-rwxr-xr-x 1 root root 1949 Feb 27 07:12 joomla.stpl
-rwxr-xr-x 1 root root 1850 Feb 27 07:12 joomla.tpl
-rwxr-xr-x 1 root root 1667 Feb 27 07:12 laravel.stpl
-rwxr-xr-x 1 root root 1562 Feb 27 07:12 laravel.tpl
-rwxr-xr-x 1 root root 5590 Feb 27 07:12 magento.stpl
-rwxr-xr-x 1 root root 5488 Feb 27 07:12 magento.tpl
-rwxr-xr-x 1 root root 1928 Feb 27 07:12 modx.stpl
-rwxr-xr-x 1 root root 1828 Feb 27 07:12 modx.tpl
-rwxr-xr-x 1 root root 2446 Feb 27 07:12 moodle.stpl
-rwxr-xr-x 1 root root 2411 Feb 27 07:12 moodle.tpl
-rwxr-xr-x 1 root root 1303 Feb 27 07:12 no-php.stpl
-rwxr-xr-x 1 root root 1204 Feb 27 07:12 no-php.tpl
-rwxr-xr-x 1 root root 1990 Feb 27 07:12 odoo.stpl
-rwxr-xr-x 1 root root 1891 Feb 27 07:12 odoo.tpl
-rwxr-xr-x 1 root root 1724 Feb 27 07:12 opencart.stpl
-rwxr-xr-x 1 root root 1624 Feb 27 07:12 opencart.tpl
-rwxr-xr-x 1 root root 2796 Feb 27 07:12 owncloud.stpl
-rwxr-xr-x 1 root root 2701 Feb 27 07:12 owncloud.tpl
-rwxr-xr-x 1 root root 2081 Feb 27 07:12 piwik.stpl
-rwxr-xr-x 1 root root 1982 Feb 27 07:12 piwik.tpl
-rw-r--r-- 1 root root 189 Feb 27 07:12 proxy_ip.tpl
-rwxr-xr-x 1 root root 2124 Feb 27 07:12 pyrocms.stpl
-rwxr-xr-x 1 root root 2021 Feb 27 07:12 pyrocms.tpl
-rwxr-xr-x 1 root root 2478 Feb 27 07:12 sendy.stpl
-rwxr-xr-x 1 root root 2390 Feb 27 07:12 sendy.tpl
-rwxr-xr-x 1 root root 1952 Feb 27 07:12 wordpress2_rewrite.stpl
-rwxr-xr-x 1 root root 1859 Feb 27 07:12 wordpress2_rewrite.tpl
-rwxr-xr-x 1 root root 1842 Feb 27 07:12 wordpress2.stpl
-rwxr-xr-x 1 root root 1743 Feb 27 07:12 wordpress2.tpl
-rwxr-xr-x 1 root root 2701 Feb 27 07:12 wordpress2_wp_super_cache.stpl
-rwxr-xr-x 1 root root 2596 Feb 27 07:12 wordpress2_wp_super_cache.tpl
-rwxr-xr-x 1 root root 1601 Feb 27 07:12 wordpress.stpl
-rwxr-xr-x 1 root root 1502 Feb 27 07:12 wordpress.tpl
[root@north php-fpm]#
上記のシナリオを取り上げます。そこにはテンプレートがあります。 “wordpress2.stpl”。 Web サーバー上でこのファイルを編集し、ディレクティブを含む行を削除します。 “SSLオン”。
nano /usr/local/vesta/data/templates/web/nginx/php-fpm/wordpress2.stpl
ラインを削除した後 “SSLオン” テンプレートからファイルを保存します。このテンプレートで追加される次のドメインには、古いディレクティブが含まれなくなります。 “SSL” ディレクティブは廃止されました、 nginx をテストするときに表示されなくなります。
同様に、すべての VestaCP Web テンプレートを変更したり、カスタマイズされた nginx および php-fpm 構成を含む新しいテンプレートを作成したりできます。