Proxy Pass based on the first field in the URI
Francis Daly
francis at daoine.org
Wed Sep 11 21:48:38 UTC 2019
On Wed, Sep 11, 2019 at 08:41:15PM +0200, meir hazon wrote:
Hi there,
> I don't think so, it should always be the first field of the URI but it
> would be a random string. I have to proxy pass and rebuild the new URI
> based on location at the original URI only.
I don't understand what your requirements are.
> > > https://yyy.com/bla/aa/er
> > > if $1 == bla proxy pass to http://xxx.com/aa/er
> > > if $1 == vv proxy pass to http://ccc.com/aa/er
"bla" is not random; it is a thing that you know that maps to xxx.com.
"vv" is not random; it is a thing that you know that maps to ccc.com.
So, somewhere, you have a list of the uri prefix / upstream server
mappings, no?
Use that list to make the nginx config.
> Could you think of a way to do this?
Not without me understanding what "this" is.
Good luck with it,
f
--
Francis Daly francis at daoine.org
More information about the nginx
mailing list