Warning when executing lnmp nginx reload in lnmp 2.1: reload nginx… nginx:[warn]The “listen … http2” directive is deprecated, use the “http2” directive instead /usr/local/nginx/conf/vhost/xxx.yyy.cn.conf:46
1. When executing lnmp nginx reload in lnmp 2.1, an error is reported: reload nginx… nginx:[warn]The “listen … http2” directive is deprecated, use the “http2” directive instead /usr/local/nginx/conf/vhost/xxx.yyy.cn.conf:46. as shown in Figure 1
[root@iZ2zeaj7tnbv8d3gsoy1w5Z wwwroot]# lnmp nginx reload
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Reload nginx... nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/vhost/xxx.yyy.cn.conf:46
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/vhost/xxxapi.yyy.cn.conf:46
done
2. Check the Nginx configuration, Listen 443 SSL http2; Modify to Listen 443 SSL; http2 on; . as shown in Figure 2
#listen 443 ssl http2;
listen 443 ssl;
http2 on;
2. Check the Nginx configuration, Listen 443 SSL http2; Modify to Listen 443 SSL; http2 on; . as shown in Figure 3
#listen 443 ssl http2;
listen 443 ssl;
http2 on;
3. Execute lnmp nginx reload again without warning.
[root@iZ2zeaj7tnbv8d3gsoy1w5Z vhost]# lnmp nginx reload
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Reload nginx... done
![在 LNMP 2.1 中 执行 lnmp nginx reload 时报错:Reload nginx... nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/vhost/xxx.yyy.cn.conf:46](https://www.shuijingwanwq.com/wp-content/uploads/2025/05/1-1.jpg)

