Answer the question
In order to leave comments, you need to log in
How to enable http2 for only one domain?
I have a VPS that hosts several sites on different domains. For one of the domains (let's call it mydomain.ru) I purchased an SSL certificate. Then I decided to enable the http2 protocol for this domain only . I made changes to the nginx configuration corresponding to this domain (added http2 after "listen 443 ssl"):
server {
listen 443 ssl http2;
server_name mydomain.ru www.mydomain.ru;
...
}
Answer the question
In order to leave comments, you need to log in
I understand that you have the only server{} that listens on port 443 - this is your mydomain.ru , so all https requests go to it.
Nikon_NLG is right. Since you have only one domain listening on port 443, requests are wrapped on it. http2-test checks only SSL, since http2 is possible through it, so it writes that other sites are accessible via http2 (although in fact nginx processes requests for mydomain.ru)
Each ip:port has one web server, which is default, that is, it processes all requests not processed by others. In case you didn't specify it manually, default will be assigned by nginx - the first one in the config. Well, or the only one, if others are not described in the config.
Accordingly, if you want other hits not to get to this site, describe another one as default or create a stub site with your server config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question