0

I am wondering if it is possible to configure Apache as a reverse proxy from /path to the root (/). I want to proxy http://server1/path to http://server2:8080 but I am not having any luck. I am finding that the path on the proxy and the backend application path must match - either as /path or / - or I get 404s from the reverse proxy because it loses the path when the request returns. If it matters the backend application is running in tomcat.

To summarize: Reverse proxy on http://server1/path -> Backend app on http://server2:8080/

I have tried modrewrite to the best of my ability but not gotten it to work. Can I rewrite the path after being processed by the reverse proxy? Or is there a better way?

jzonthemtn
  • 101
  • 1
  • 3
  • The best tip I can give you is to check the browsers console and map the reverseproxies according to that. This is a good example: https://serverfault.com/questions/799012/dynmap-throu-mod-proxy-on-a-external-webserver – Orphans Nov 28 '17 at 07:11

1 Answers1

0

Did you try something like that:

<Location "/path/">
    ProxyPass "http://server2:8080/"
</Location>

If so, what does not work?

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43
  • I have tried it, and the target server (server2) is interpreting "path" as part of the request path – usr-local-ΕΨΗΕΛΩΝ Feb 27 '20 at 10:12
  • @usr-local-ΕΨΗΕΛΩΝ If you have a new question, post it as such. Make sure to provide details of your troubleshooting, because the excerpt above, and its behavior, is straight out of Apache documentation, see https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass – Patrick Mevzek Feb 27 '20 at 14:45