14

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;
  [...]
}

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

My NginX version is 1.10.1

Greets Jan

2
  • Look for http2 in other server blocks. Commented Sep 12, 2016 at 14:53
  • There are other server blocks with entabled htt2. Can't I disable it only for one server block? Commented Sep 12, 2016 at 15:33

2 Answers 2

27

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

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.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for pointing this out. I just tried that myself, you actually have to disable http2 in all virtual host to disable http2. This actually sucks...
This just got me crazy for a while and I have seen this after I solved.
got me crazy too, had to disable http2 for all other vhosts before it points back to http1/1
This can't possibly be true because my server is serving http1.1 on the ip address and h2 on the domain.
This answer is incomplete as it stands
6

NGINX can't serve multiple protocol on 1 port. Make it different port. Example : HTTP/2 on port 443

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

and then HTTP 1.1 on port 444

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

or if you wanna disable http/2 module, re-install NGINX without --with-http_v2_module

1 Comment

This can't possibly be true because my server is serving http1.1 on the ip address and h2 on the domain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.