send custom host to backend

how to change the “Host” variable in the http header sent to the backend.

for example, your browser calls www.site.com but the backend expects www.website.com.

add the following two lines to the proxy rule for www.site.com:

...
set $my_host "www.website.com";
...
location / {
    ...
    proxy_set_header Host $my_host;
    proxy_pass ....