Mobile app version of vmapp.org
Login or Join
Candy875

: What virtual host should I serve when someone hits my webserver without a "Host:" header? I have a single instance of nginx serving several virtual hosts with their respective domains on the

@Candy875

Posted in: #IpAddress #MultipleDomains #Virtualhost #Webserver

I have a single instance of nginx serving several virtual hosts with their respective domains on the same ip address. When someone tries to access my ip, they are served one of them, but since my server redirects all requests to https, those client fail. What virtual host should I serve instead? Should I use rewrite to force a specific domain?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sue5673885

Considering RFC-7230, you might just return 400 for such request:


A server MUST respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header field and to any request message that contains more than one Host header field or a Host header field with an invalid field-value.


Unless you have a good reason to redirect them to a specific domain.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme