I have an NGINX config:
upstream djangobackend {
server svr1.int.example.com:80;
server svr2.int.example.com:80;
server svr3.int.example.com:80;
}
server {
location / {
proxy_pass http://djangobackend;
}
}
My problem is that NGINX seems to be rewriting the HOSTNAME to 'djangobackend' when making requests of the upstream svrX machines.
This is an issue, as I have multiple domain names for the same site (subdomains for larger customers). So is I request http://customer42.example.com/index.html
svrX sees http://djangobackend/index.html
and does not know to customize the page for customer42.
I can work round this with one NGINX virtual server per subdomain (using different upstream names for each virtual server), but this does not scale beyond a half dozen customers.
How can I fix this?