Nginx proxy domain to another domain with no change URL
Solution 1:
You set:
proxy_set_header Host $host;
You want:
proxy_set_header Host connect2.domain.ru;
Solution 2:
So I think - here is the solution if I understood the problem correctly:
# backend.wants.this.server.com
# browser.shows.this.server.com
server {
listen 80;
server_name browser.shows.this.server.com;
location / {
proxy_set_header Host backend.wants.this.server.com;
proxy_redirect http://backend.wants.this.server.com/ http://browser.shows.this.server.com/;
}
}
Solution 3:
Telepathy about port 8080 has been turned off, because you don't show us the full config.
server {
listen 80;
server_name connect3.domain.ru www.connect3.domain.ru;
location / {
proxy_pass http://connect2.domain.ru;
proxy_set_header Host connect2.domain.ru;
}
}