preserve url in browser with proxy_pass redirection is not working
August 25, 2021 01:52PM
Hi ,

I am having a custom domain ( say customdomain.com) and i want to redirect to another domain page ( say webapp.com/at/user). The destination domain has ssl enabled so that it will be redirected to it's https version automatically. I have created nginx configuration as below :

server {

listen 80;
listen [::] 80;
server_name customdomain.com;
location {
proxy_pass http://webapp.com/at/user;
}
}

When i open customdomain.com in browser, the page from webapp.com/at/user is loading but the URL ( customdomain.com) is not preserved in browser address bar. It is showing the https://webapp.com/at/user. Any idea on how to fix this?

But the preserving url shall work if https is not enabled in webapp.com.

Any help would be really appreciated. Thanks in advance.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 199
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