nginx server_name directive

Nginx uses host header for matching the server_name directive. In HTTP 1 clients set this header but in HTTP2 this header has been replaced with :authority psudo header. So if you're using HTTP2 in nginx and this header is absent then it falls back to the first server directive and for example if you have two sub domains with different backends, then navigating to first sub domain might render second subdomain for you.

Nginx relies on the Host header to match requests with the server_name directive. While HTTP/1 clients use the Host header, HTTP/2 replaces it with the :authority pseudo-header.

If the host header is absent in a request, Nginx defaults to the first server block defined in the configuration. This can lead to unexpected behavior, such as serving the wrong content for a subdomain. For instance, if you have two subdomains with separate backends, navigating to one subdomain might incorrectly render the other.

To prevent this, ensure proper configuration and testing for HTTP/2 compliance in your Nginx setup.