Welcome! Log In Create A New Profile

Advanced

Re: Use sub-url to identify the different server

Francis Daly
January 10, 2019 06:50PM
On Thu, Jan 10, 2019 at 02:54:14AM -0500, nevereturn01 wrote:

Hi there,

> I have 2 internal web hosts & 1 dedicate Nginx as reverse proxy, eg 10.1.1.1
> & 10.1.1.2
>
> Now, I need to access the different hosts via sub-url. eg:
>
> 1. https://www.domain.com/site1 -----> https://10.1.1.1/
> https://www.domain.com/site1/ui -----> https://10.1.1.1/ui/
> 2. https://www.domain.com/site2 -----> https://10.1.1.2/
> https://www.domain.com/site2/ui -----> https://10.1.1.2/ui/

If you have the freedom to change the internal web hosts, such that
(for example) the 10.1.1.1 content is all locally below the url
//10.1.1.1/site1/ instead of //10.1.1.1/, then you will probably find
it much easier to reverse-proxy them.

location /site1 { proxy_pass https://10.1.1.1; }
location /site2 { proxy_pass https://10.1.1.2; }

is possibly all you would need in that case.

If you can't do that, then the start of what you will need will be
more like

location /site1/ { proxy_pass https://10.1.1.1/; }
location /site2/ { proxy_pass https://10.1.1.2/; }

but you will have to take care that anything that is returned to the
client that will be interpreted as a url, will be interpreted the way
you want it to be. If the internal servers do not make that easy, it
will probably not be easy for you.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Use sub-url to identify the different server

nevereturn01 January 10, 2019 02:54AM

Re: Use sub-url to identify the different server

Francis Daly January 10, 2019 06:50PM

Re: Use sub-url to identify the different server

nevereturn01 January 13, 2019 10:18PM

Re: Use sub-url to identify the different server

Francis Daly January 14, 2019 09:08AM

Re: Use sub-url to identify the different server

nevereturn01 January 20, 2019 10:13PM

Re: Use sub-url to identify the different server

Francis Daly January 24, 2019 04:00AM

Re: Use sub-url to identify the different server

nevereturn01 February 10, 2019 10:21PM

Re: Use sub-url to identify the different server

Francis Daly February 11, 2019 05:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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