Intended behavior for Host header in Proxy scenario

Jack Henschel jackdev at
Thu Nov 22 20:11:59 UTC 2018

Hello everyone,

during my last debugging session with Nginx I was wondering how and when
exactly Nginx passes upstream's hostname when proxying a request.

In particular, I have the following example:
> upstream backend {
>   server;
>   server;
> }

> server {
>   proxy_pass https://backend/path;
>   proxy_set_header Host $proxy_host; # default according to docs
> }

I observed that Nginx does not always pass the appropriate Host header
to the upstream server (i.e. "" for "server" and "" for "server").

Is this observation correct or am I missing something?


More information about the nginx mailing list