LNMP一键包重启nginx: [warn] the “listen … http2” directive is deprecated

179 浏览技术资料
0

今天遇到了LNMP一键包重启nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead。

查了一资料,原来是Nginx 1.25.1 主线版发布后,弃用了listen指令的http2参数,单独加入了 http2 指令。也就是原来Nginx的配置:

server
    {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
        ……

要修改成如下面:

server
    {
        listen 443 ssl;
        listen [::]:443 ssl http2;
        http2  on;
        ……

即把http2 on单独写成一行。


分享到:
Qi 问的问题 2024年7月24日
添加评论
写下您的答案。

Login

Welcome! Login in to your account

Remember meLost your password?

Don't have account. Register

Lost Password

Register