Re:Nginx Development Guide
by morelisp on Wednesday August 16, 2023 @12:22PM
(#37149425)
> did you know that if there is no Host header nginx serves the site evaluated first in its config file (even if the site has a server_name directive)?
Before that it goes to the one named "" and if that doesn't exist, the one with default_server.
If traffic with no Host header went to no server by default, people would also call that a footgun...
Re:Nginx Development Guide
by Macha on Wednesday August 16, 2023 @02:23PM
(#37151432)
Setting a server_name is something you need to opt into. So I feel it should be required to match to serve that vhost. If you didn't want it to apply only to the right vhost, don't configure it to require a specific vhost?
Before that it goes to the one named "" and if that doesn't exist, the one with default_server.
If traffic with no Host header went to no server by default, people would also call that a footgun...