Welcome! Log In Create A New Profile

Advanced

Nginx proxy_pass not working as expected.

October 28, 2016 09:12AM
Hi

I have the virtualhost file configured as the following:-

server {
server_name example.com;

location / {
proxy_pass http://example.org;
}
}


When I visit example.com it redirects correctly to example.org, but I need it to show example.com in the address bar. How can I do this?

i tried changing it to

location / {
proxy_pass http://example.org;
proxy_set_header Host example.com;
}
}

but it still shows example.org in the address bar, what do I need to do?

Thanks
Subject Author Posted

Nginx proxy_pass not working as expected.

stuwat October 28, 2016 09:12AM

Re: Nginx proxy_pass not working as expected.

jeffdyke October 28, 2016 10:04AM

Re: Nginx proxy_pass not working as expected.

stuwat October 28, 2016 10:17AM

Re: Nginx proxy_pass not working as expected.

Francis Daly October 28, 2016 12:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 267
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready