“nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in example.com.nginx.ssl.conf“ هو تنبيه شائع على خوادم الويب ذات تكوينات nginx القديمة أو مع VestaCP.
محتوى
nginx -t

يظهر هذا التحذير في أغلب الأحيان على الخوادم التي تم تثبيت VestaCP عليها قبل بضع سنوات، عندما يكون في التكوين nginx كان التوجيه ضروريا “ssl on“.
كيفية الإصلاح “SSL” تم إهمال التوجيه في نجينكس / فيستاCP
الطريقة الأولى: قم بتحرير ملف nginx.conf الخاص بالمجال
أسهل شيء بالنسبة لنا هو إلغاء التوجيه بـ # “تشغيل طبقة المقابس الآمنة” للمجال حيث لدينا تحذير 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.
الطريقة الثانية: التحرير VestaCP Web Template ل نجينكس.
قبل أن نضيف واحدة مستخدم في فيستاCP، نحن بحاجة إلى إنشاء الحزم. VestaCP Packages. تحتوي هذه الحزم على العديد من التكوينات لأنظمة إدارة المحتوى أو البرامج النصية المختلفة. Web Template (Nginx), Backend Template (PHP-FPM), DNS Template (NAMED).
عندما نضيف أ مجال على واحد المستخدم فيستاCP، سيتم توفير تكوين Nginx الافتراضي للنطاق المضاف حديثًا بواسطة Web Template ((نجينكس) المحدد لحزمة المستخدمل.

نحن نأخذ السيناريو الذي نضيف فيه Vesta Package Name: Stealth النحاس Web Template NGINX: wordpress2. إذا كان القالب “wordpress2” يحتوي على التوجيه “ssl on”، فإن النطاقات الجديدة المضافة باستخدام هذا القالب ستحتوي على هذا التوجيه القديم الذي تم تكوينه. لذلك فمن الأفضل سا تعديل Web Template في فيستاCP. وبالتالي فإن المجالات الجديدة المضافة لن تتلقى بعد الآن “تشغيل طبقة المقابس الآمنة” في تكوين Nginx.
عندما تم نشره Web Template VestaCP للقضاء “ssl” directive is deprecated” ؟
توجد القوالب التي تكتب ملفات التكوين للنطاقات المضافة في:
/usr/local/vesta/data/templates/web/nginx/php-fpm
هذه لها نهايتان. .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”. نقوم بتحرير هذا الملف على خادم الويب وحذف السطر الذي يحتوي على التوجيه “تشغيل طبقة المقابس الآمنة”.
nano /usr/local/vesta/data/templates/web/nginx/php-fpm/wordpress2.stpl
بعد إزالة الخط “تشغيل طبقة المقابس الآمنة” من القالب، احفظ الملف. المجالات التالية التي ستتم إضافتها مع هذا القالب لن تحتوي بعد الآن على التوجيه القديم. “SSL” تم إهمال التوجيهو لن يظهر بعد الآن عند اختبار nginx.
بنفس الطريقة، يمكن تعديل جميع قوالب الويب VestaCP أو إنشاء قوالب جديدة لتشمل تكوينات nginx وphp-fpm المخصصة.