<div dir="ltr">Hi,<div><br></div><div>It looks great, I will try it out and let you know.</div><div><br></div><div>Thanks so much,</div><div><br></div><div>Meir</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 11, 2019 at 5:56 PM j94305 <<a href="mailto:nginx-forum@forum.nginx.org">nginx-forum@forum.nginx.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">Try something like this:<br>
<br>
map $urlprefix $urlproxy {<br>
"foo" "<a href="https://foohost.foo.com" rel="noreferrer" target="_blank">https://foohost.foo.com</a>";<br>
"bar" "<a href="http://barhost.blah.com" rel="noreferrer" target="_blank">http://barhost.blah.com</a>";<br>
"fie" "<a href="https://fie.special.domain.com/blubb" rel="noreferrer" target="_blank">https://fie.special.domain.com/blubb</a>";<br>
default "<a href="https://standard.com" rel="noreferrer" target="_blank">https://standard.com</a>";<br>
}<br>
<br>
[...] <br>
<br>
location ~ "^/(?<urlprefix>[^/]+)(?<urlsuffix>/.*)$" {<br>
<br>
[...]<br>
proxy_pass "$urlproxy$urlsuffix$is_args$args";<br>
[...]<br>
}<br>
<br>
You can dynamically determine the host (including a URL piece, if necessary)<br>
with the "map", and use the mapped proxy prefix then in the proxy_pass<br>
directive. If whatever lies beyond the NGINX requires URL arguments, don't<br>
forget the $is_args$args part.<br>
<br>
--j.<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,285607,285609#msg-285609" rel="noreferrer" target="_blank">https://forum.nginx.org/read.php?2,285607,285609#msg-285609</a><br>
<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>