I have been playing with nginx and I encountered a problem:
upstream backend_hosts {
server server1.example.com
server server2.example.com
}
server {
listen 80;
location / {
proxy_pass http://backend_hosts;
proxy_set_header Host $name_of_current_upstream (eg. if proxy pass is server1.example.com then the host header would be server1.example.com)
}
}
But there is no such variable as $name_of_current_upstream and no way to generate it.
I need my Host to be set to actual name of current upstream server and that's not possible without workarounds
http://serverfault.com/questions/598202/make-nginx-to-pass-hostname-of-the-upstream-when-reverseproxying
Edited 1 time(s). Last edit at 10/23/2016 04:16PM by neco.