<div dir="ltr">Dear Francis and friends,<div><br></div><div>I am sorry if I wasn't clear enough, I appreciate your help and advice dearly. </div><div><br></div><div>I was thinking on creating environments dynamically, Meaning,</div><div><br></div><div>1. the source "host" of the URL is random</div><div><br></div><div>2. The first field of the URI includes a random string with the environment ID.</div><div><br></div><div>3. Based on this ID a proxy pass is added (I will add DNS records etc.)</div><div><br></div><div>4. The proxy pass points to a static "host" and the URI includes the original URI excluding the first filed (env ID field)</div><div><br></div><div>Meaning that I will need a good rewrite and an "if" statement for each one of the environments (IDs)</div><div><br></div><div>Could you please </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 11, 2019 at 11:48 PM Francis Daly <<a href="mailto:francis@daoine.org">francis@daoine.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Sep 11, 2019 at 08:41:15PM +0200, meir hazon wrote:<br>
<br>
Hi there,<br>
<br>
> I don't think so, it should always be the first field of the URI but it<br>
> would be a random string. I have to proxy pass and rebuild the new URI<br>
> based on location at the original URI only.<br>
<br>
I don't understand what your requirements are.<br>
<br>
> > > <a href="https://yyy.com/bla/aa/er" rel="noreferrer" target="_blank">https://yyy.com/bla/aa/er</a><br>
> > > if $1 == bla proxy pass to <a href="http://xxx.com/aa/er" rel="noreferrer" target="_blank">http://xxx.com/aa/er</a><br>
> > > if $1 == vv proxy pass to <a href="http://ccc.com/aa/er" rel="noreferrer" target="_blank">http://ccc.com/aa/er</a><br>
<br>
"bla" is not random; it is a thing that you know that maps to <a href="http://xxx.com" rel="noreferrer" target="_blank">xxx.com</a>.<br>
<br>
"vv" is not random; it is a thing that you know that maps to <a href="http://ccc.com" rel="noreferrer" target="_blank">ccc.com</a>.<br>
<br>
So, somewhere, you have a list of the uri prefix / upstream server<br>
mappings, no?<br>
<br>
Use that list to make the nginx config.<br>
<br>
> Could you think of a way to do this?<br>
<br>
Not without me understanding what "this" is.<br>
<br>
Good luck with it,<br>
<br>
        f<br>
-- <br>
Francis Daly        <a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>