Discussion:
Hostname rewrite based on location in URL?
(too old to reply)
t***@gmail.com
2016-06-17 17:46:03 UTC
Permalink
Hi all,

I have a odd situation where I need to reverse proxy to several internal hosts based on the location

For example, www.example.com/75647 would proxy to a specific internal server. The issue is that the web application requires a specific hostname in order to work.

So, what I would need to do is anything that comes into the url www.example.com/75647 would reverse proxy to: myexample.example.com

We have several of these internal hosts and the user accesses them based on the location (ex. 75647), which changes. We have a proxy.conf file that has all of these locations (<Location /75647>....</Location>) defined, but all need a hostname rewrite to myexample.example.com. The proxy.conf file is written dynamically with confd.

Is this possible using rewrite conditions or is there a more simple way?

Thanks
Andy
Валентин Ким
2016-06-24 14:34:56 UTC
Permalink
Post by t***@gmail.com
Is this possible using rewrite conditions or is there a more simple way?
Thanks
Andy
RewriteRule "^/www.example.com/75647(.*)" "/myexample.example.com" [R]
Loading...