在执行nginx -t时报以下错误

[root@daolian conf]# /usr/local/nginx/sbin/nginx -t
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/nginx.conf:88
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /usr/local/nginx/conf/nginx.conf:147
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful

解决方案如下:

1.编辑nginx.conf文件

[root@daolian conf]# vi nginx.conf 

找到

                 listen       8082 ssl http2;

更改为

                 listen       8082 ssl;
                 http2        on;

2. 重新检测配置文件

[root@daolian conf]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
 

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐