Proxy Pass based on the first field in the URI
meir hazon
meir.hazon at ev-box.com
Thu Sep 12 07:34:20 UTC 2019
Dear Francis and friends,
I am sorry if I wasn't clear enough, I appreciate your help and advice
dearly.
I was thinking on creating environments dynamically, Meaning,
1. the source "host" of the URL is random
2. The first field of the URI includes a random string with the environment
ID.
3. Based on this ID a proxy pass is added (I will add DNS records etc.)
4. The proxy pass points to a static "host" and the URI includes the
original URI excluding the first filed (env ID field)
Meaning that I will need a good rewrite and an "if" statement for each one
of the environments (IDs)
Could you please
On Wed, Sep 11, 2019 at 11:48 PM Francis Daly <francis at daoine.org> wrote:
> 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
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190912/67c240cb/attachment.htm>
More information about the nginx
mailing list