Re: Proxy Pass based on the first field in the URI

2019-09-14 Thread j94305
PS: If, like you mentioned in the other reply message, want to create environments dynamically, you could use the map directive with an include file that is dynamically updated by the deployment process of such an environment (and then do nginx -s reload), but even more elegant would be the replace

Re: Proxy Pass based on the first field in the URI

2019-09-12 Thread meir hazon
Sorry, the only random is the first part of the URI, Following is the right description, 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 stat

Re: Proxy Pass based on the first field in the URI

2019-09-12 Thread meir hazon
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. Ba

Re: Proxy Pass based on the first field in the URI

2019-09-11 Thread Francis Daly
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 requ

Re: Proxy Pass based on the first field in the URI

2019-09-11 Thread meir hazon
Hi, It looks great, I will try it out and let you know. Thanks so much, Meir On Wed, Sep 11, 2019 at 5:56 PM j94305 wrote: > Try something like this: > > map $urlprefix $urlproxy { > "foo" "https://foohost.foo.com";; > "bar" "http://barhost.blah.com";; > "fie" "https://fie.special.domai

Re: Proxy Pass based on the first field in the URI

2019-09-11 Thread meir hazon
Hi, 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. Could you think of a way to do this? Thanks so much, Meir On Wed, Sep 11, 2019 at 5:46 PM Francis Daly

Re: Proxy Pass based on the first field in the URI

2019-09-11 Thread j94305
Try something like this: map $urlprefix $urlproxy { "foo" "https://foohost.foo.com";; "bar" "http://barhost.blah.com";; "fie" "https://fie.special.domain.com/blubb";; default "https://standard.com";; } [...] location ~ "^/(?[^/]+)(?/.*)$" { [...] proxy_pass "$urlproxy$urlsuffix$is_

Re: Proxy Pass based on the first field in the URI

2019-09-11 Thread Francis Daly
On Wed, Sep 11, 2019 at 04:45:21PM +0200, meir hazon wrote: Hi there, > I would also like to pass the message to the proxy without the first part > of the URI but use the rest of it. http://nginx.org/r/proxy_pass includes the section: """ If the proxy_pass directive is specified with a URI, th

Proxy Pass based on the first field in the URI

2019-09-11 Thread meir hazon
Hello, I have tried to do the following but couldn't pull it out. Maybe you will have a good idea as I am not an expert. I would like to proxy pass to different proxies based on the first part of a URI. I would also like to pass the message to the proxy without the first part of the URI but use