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。如图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](https://media.shuijingwanwq.com/2025/05/1-1.jpg)
Plaintext
[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、查看 Nginx 配置, listen 443 ssl http2; 修改为 listen 443 ssl; http2 on; 。如图2

Plaintext
#listen 443 ssl http2;
listen 443 ssl;
http2 on;
2、查看 Nginx 配置, listen 443 ssl http2; 修改为 listen 443 ssl; http2 on; 。如图3

Plaintext
#listen 443 ssl http2;
listen 443 ssl;
http2 on;
3、再次执行 lnmp nginx reload ,不再警告。
Plaintext
[root@iZ2zeaj7tnbv8d3gsoy1w5Z vhost]# lnmp nginx reload
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| https://lnmp.org |
+-------------------------------------------+
Reload nginx... done
