Nginx 1.25.1 版本后 http2 监听指令警告问题及解决方案

在 1.25.1 版本后的 nginx 运行日志中,会出现下面的警告:

“nginx: [warn] the "listen... http2" directive is deprecated, use the "http2" directive instead”文章源自堕落的鱼-https://www.duoluodeyu.com/2781.html

原因分析

http2 监听指令的用法发生了更改,以往的使用模式已被弃用。在 NGINX 1.25.1 中,listen... http2 指令被弃用,使用 nginx -t 进行配置检查时会发出警告。文章源自堕落的鱼-https://www.duoluodeyu.com/2781.html

解决方案

若原配置为 listen 443 ssl http2;,需修改为:文章源自堕落的鱼-https://www.duoluodeyu.com/2781.html

listen 443 ssl;
http2 on;

修改完成后,通过 sudo nginx -s reload 命令重启 nginx 使配置生效。文章源自堕落的鱼-https://www.duoluodeyu.com/2781.html

文章源自堕落的鱼-https://www.duoluodeyu.com/2781.html文章源自堕落的鱼-https://www.duoluodeyu.com/2781.html
 
常用正则表达式汇总 网站建设

常用正则表达式汇总

很多不太懂正则的朋友,在遇到需要用正则校验数据时,往往是在网上去找很久,结果找来的还是不很符合要求。所以我最近把开发中常用的一些正则表达式整理了一下,在这里分享一下。给自己留个底,也给朋友们做个参考。...
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:
确定

拖动滑块以完成验证