Nginx: how to set host header to the server chosen (load balancing)

Solution 1:

You need to set the header to the incoming host variable, as documented here:

proxy_set_header Host $host;