I have a site that works as load balancer. Site A.
I have other sites that only can have one domain. So if i just redirect to them it says host name not found.
So if i manually set header to something then only that site shows up.
How can i set proxy_set_header Host xxxx
to server address chosen. This way each rerouting request will have different and appropriate host header.
It won't be a problem if my other 2 sites could work based on url and not host header.
worker_processes 1; error_log logs/error.log; error_log logs/error.log notice; error_log logs/error.log info; error_log logs/error.log debug; pid logs/nginx.pid; events { worker_connections 1024; } http { upstream myapp1 { #server localhost:3333; server www.asd.com:80; } server { listen 80; location / { proxy_set_header Host $upstream_addr; // should become somehow www.asd.com right now this code doesn't work proxy_set_header X-Forwarded-For $remote_addr; proxy_pass http://myapp1; } } }
$server_addr
is somehow 127.0.0.1 why??www.asd.com:80
is chosenif(server1) than host = a;
,if(server2) than host = b;