Welcome! Log In Create A New Profile

Advanced

Nginx reverse proxy and disable some webpage

Posted by davejohn 
Nginx reverse proxy and disable some webpage
February 12, 2015 05:17AM
I have a web server A and another server B running nginx.

A is internal network while B sit on DMZ where it run nginx and expose to the internet.
so user can browse all the site on A by accessing B via URL as B is using proxy_pass to A.


These are some of the URL i have
http://serverB.com/data/ver1/
http://serverB.com/data/ver2/
http://serverB.com/data/ver3/

I would like to do a URL rewriting so that it will look like
http://serverB.com/ver1/
http://serverB.com/ver2/
http://serverB.com/ver3/

what I did was

location /ver1 {
proxy_pass http://http://serverA.com/ver1
}


It works initially , but if i were to click a link in the page, the URL goes back to http://serverB.com/data/ver1/link/

how do i permanently rewrite the url of the page /
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 333
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready