I'm trying to set up a proxy in an Apache web server but I have an issue about the build of URL beacause in the resulting URL part of the path is missing. An example:
http://server/webapp/style.css
(expected)
http://server/style.css
(real result)
I have a server exposed on the web (that I will call frontendserver) and another server (backendserver) in an internal network (non accessible from the web) where there is the web application that I want to proxy outside. I tried some methods and the main issue is that in the proxy the URL is not (re)-written in the right way, the server or browser miss a part.
What I tried:
ProxyPass /webapp http://backendserver
ProxyPassReverse /webapp http://backendserver
The URL of the app in the browser is correct http://frontendserver/webapp
; the index.html is visible but all the annexed resources (js, sockets, css, etc.) are missing because their URLs are http://frontendserver/style.css
instead of http://frontendserver/webapp/style.css
.
Is this the right method to set up this type of proxy properly?
I have tried some other solution also with the Apache rewrite module but I do not reach a good result, maybe someone have a good suggestion to solve the issue.
Thanks