Proxy Pass based on the first field in the URI

meir hazon meir.hazon at
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

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

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> 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.
> > > >
> > > > if $1 == bla proxy pass to
> > > > if $1 == vv proxy pass to
> "bla" is not random; it is a thing that you know that maps to
> "vv" is not random; it is a thing that you know that maps to
> 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
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list