在 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
1、在 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。如图12、查看 Nginx 配置, listen 443 ssl http2; 修改为 listen 443 ssl; http2 on; 。如图22、查看 Nginx 配置, listen 443 ssl http2; 修改为 listen 443 ssl; http2 on; 。如图33、再次执行 lnmp nginx reload ,不再警告。
[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
#listen 443 ssl http2;
listen 443 ssl;
http2 on;
#listen 443 ssl http2;
listen 443 ssl;
http2 on;
[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)

