: 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
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?
More posts by @Candy875
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.