本文介绍了如何在Nginx中禁用HTTP2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 HTTP/2和Form POSTS的Safari问题,我想禁止通过HTTP/2.因此,我只是从相应的nginx服务器块中的server_name指令中删除了"http2".

due to this Safari Issue with HTTP/2 and Form POSTS I wanted to disable serving one Webpage via HTTP/2. So I just removed the "http2" from the server_name directive in corresponding nginx server block.

server {
  listen x.x.x.x:443 ssl;
  server_name xxxx;
  [...]
}

但是,当我重新启动NginX并在各种浏览器中打开网站后,HTTP/2协议仍在使用...我在做什么错了?

But after I restarted NginX and opened the website in various browsers the HTTP/2 Protocol is still used...What am I doing wrong?

我的NginX版本是1.10.1

My NginX version is 1.10.1

问候Jan

推荐答案

有人在这里回答了正确的解决方法,但是帖子不见了...

Someone answered with the correct solution here, but the post disappeared...

您必须为一个IP地址/端口上的所有服务器块禁用http2.如果有一个服务器块配置为启用http2,则该IP上的所有服务器块均已启用.

You have to disable http2 for all server blocks on one IP Adress / Port. If there is one server block configured to enable http2 it is enabled for all server blocks on this IP.

这篇关于如何在Nginx中禁用HTTP2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 14:27