“nginx: [warn] the “ssl” directive is deprecated, use the “listen … ssl” directive instead in example.com.nginx.ssl.conf“ là một cảnh báo phổ biến trên các máy chủ web có cấu hình nginx cũ hoặc VestaCP.
Nội dung
nginx -t

Này warn xuất hiện thường xuyên nhất trên máy chủ có VestaCP được cài đặt một vài năm trước, khi trong cấu hình nginx chỉ thị là cần thiết "ssl on
".
Làm thế nào để khắc phục "lệnh ssl" không còn được dùng nữa trong Nginx / VestaCP
Phương pháp 1. Chỉnh sửa tệp nginx.conf cho lĩnh vực
Cách dễ nhất là hủy lệnh "ssl on" bằng # cho tên miền mà chúng tôi có cảnh báo nginx.
sudo nano /home/vestacpuser/conf/web/example.com.nginx.ssl.conf
# ssl on

Lưu tệp và sau đó chạy lại nginx -t
. Lỗi nginx: [warn] the “ssl” directive is deprecated…” nó sẽ không còn nữa.
nginx -t
Bằng phương pháp này, lỗi sẽ không được khắc phục vĩnh viễn. Các miền mới sẽ tuân theo tệp cấu hình của gói được chỉ định cho tài khoản trên VestaCP.
Phương pháp 2. Chỉnh sửa VestaCP Web Template cho Nginx.
Trước khi chúng tôi thêm một người sử dụng in VestaCP, chúng ta cần tạo các gói. VestaCP Packages. Các gói này chứa một số cấu hình cho các CMS hoặc tập lệnh khác nhau. Web Template (Nginx), Backend Template (PHP-FPM), DNS Template (NAMED).
Khi chúng tôi thêm một lĩnh vực trên người sử dụng VestaCP, cấu hình Nginx mặc định của miền mới được thêm vào sẽ được cung cấp bởi Web Template (Nginx) đã chọn cho gói người dùngTrang web.

Chúng tôi đưa ra kịch bản trong đó chúng tôi thêm Vesta Package Name: Stealth cu Web Template NGINX: wordpress2. Nếu mẫu “wordpress2” chứa chỉ thị “ssl on”, các miền mới được thêm với mẫu này sẽ có chỉ thị lỗi thời này trong cấu hình. Vì vậy, nó là tốt nhất để sửa đổi Web Template in VestaCP. Do đó, các miền mới được thêm sẽ không còn nhận được "ssl on" trong cấu hình Nginx nữa.
Làm thế nào để chỉnh sửa một Web Template VestaCP loại bỏ “ssl” directive is deprecated” ?
Các mẫu ghi tệp cấu hình của các miền đã thêm nằm trong:
/usr/local/vesta/data/templates/web/nginx/php-fpm
Chúng có hai kết thúc. .tpl
vì miền không có SSL và .stpl
vì miền với SSL Trên.
[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]#
Chúng tôi lấy kịch bản ở trên, trong đó chúng tôi có mẫu "wordpress2.stpl". Chúng tôi chỉnh sửa tệp này trên máy chủ web và xóa dòng có lệnh "ssl on".
nano /usr/local/vesta/data/templates/web/nginx/php-fpm/wordpress2.stpl

Sau khi xóa dòng "ssl on" khỏi mẫu, hãy lưu tệp. Các miền sau sẽ được thêm bằng mẫu này sẽ không còn lệnh lỗi thời nữa. "lệnh ssl" không còn được dùng nữa, sẽ không xuất hiện khi thử nghiệm nginx.
Theo cách tương tự, tất cả các mẫu web có thể được sửa đổi VestaCP hoặc những cái mới có thể được tạo để bao gồm các cấu hình nginx và php-fpm tùy chỉnh.