找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 30|回复: 0

[oneinstack] oneinstack提示nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in的解决方法

[复制链接]

5

主题

0

回帖

15

积分

新手上路

积分
15
发表于 3 天前 | 显示全部楼层 |阅读模式
将nginx更新到1.26.1后,执行nginx -t提示 nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in,以为是更新nginx1.26.1出现错误,搜索后才明白是nginx1.25.1版本开始对配置文件弃用了一些旧指令。
Image



解决方法很简单,找到网站的nginx配置文件,本站服务器使用oneinstack脚本管理的,网站的nginx文件路径为 /usr/local/nginx/conf/vhost,只需要将这个路径下的所有网站的nginx文件打开,去掉http2。
修改前:
listen 443 ssl http2;
listen [::]:443 ssl http2;
Image



修改后:
listen 443 ssl;
listen [::]:443 ssl;
Image



然后执行service nginx restart 重启nginx服务,再执行 nginx -t 命令,已没有警告提示信息。
Image




您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|一起港湾 ( 青ICP备2025004122号-1 )

GMT+8, 2025-4-22 16:37 , Processed in 0.119513 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表