How to proxy an Apache URI to an application listening on a specific port?

Viewed 18

I need to proxy based on a URI for example.

/redis/ -> http://127.0.0.1:5000/

The problem I'm running into is when I go to https://example.com/redis/ it gives me an error since it does not insert the uri /redis/ on the links within the html page hence the subsequent calls never go through the proxy since it no longer as the URI.

Error: https://example.com/main.7285e310f55373bbbd87.css net::ERR_ABORTED 404 (Not Found) for some reason it is not added the redis between the domain and content page. Should be https://example.com/redis/main.7285e310f55373bbbd87.css

I've tried a few things and none worked:

ProxyPass /redis/ http://127.0.0.1:5000/
ProxyPassReverse /redis/ http://127.0.0.1:5000/

and

<Location /redis>
   RewriteEngine On
   RewriteRule ^/redis/(.*) /$1
   ProxyPass http://127.0.0.1:5000/ nocanon
   ProxyPassReverse http://127.0.0.1:5000/
</Location>

and

<Proxy *>
   Order deny,allow
   Allow from localhost
</Proxy>
ProxyPass /redis/ http://127.0.0.1:5000/

My goal is to be able to route traffic based on the URI back to a couple of different application server. Currently using Apache 2.4.

Thanks

0 Answers
Related