Nginx

Nginx Proxy requests are redirecting to upstream name.

If you are using nginx as a reverse proxy and having the redirection issues to upstream name when proxy request results in 301,302 redirects, e.g.

http://www.mind-geek.net/new.html is proxied by backend upstream i.e.

upstream backend {
server 54.21.42.13:80;
}

location / {
proxy_pass http://backend;
}

and the requests are getting ended eith http://backend/new.html, than you need to sepecify the proxy_headerr host in proxy requests, which is :

proxy_set_header Host $http_host;

so finally it becomes:

location / {
proxy_set_header Host $http_host;
proxy_pass http://backend;
}

Now all you requests and 302,301 redirects will consist valid domain name(host).

You Might Also Like