N00b question. I have an URL
http://myserver.com/game
and would like to call an internal resource
http://localhost:5732/
I tried:
AllowCONNECT 5732
ProxyPass /game/ http://localhost:5732/ nocanon
ProxyPassReverse /game/ http://localhost:5732/
but the HTML coming back contained links that didn't get /game/ prepended and JS and CSS broke. So I tried:
RewriteEngine On
RewriteRule ^/game(.*) http://localhost:5732$1
but that sends a redirect (which of course doesn't work) to the browser.
What do I get wrong? My goal is:
http://myserver/game --> http://localhost:5732/
Help is greatly appreciated
If your Apache version is recent enough (2.4+), you can try mod_proxy_html
For older versions of apache, you can try with mod_substitute. However, this requires you to manually write your regexes. This could be a starting point:
Of course, the exact configuration will depend on what output you currently get from your game server.
The first version you did, with ProxyPass and ProxyPassReverse, is the most common way to do what you want. The problem is that whatever it is you've got running on localhost:5732 is the thing that creates the HTML that will be sent back - and it doesn't know that it's not called localhost:5732. Your proxypass doesn't change the pages that are passed through, it so if your game contains all the wrong links, that's what you'll see.
So, to make this work, you need to reconfigure your game thingy so it knows to present its links etc as your.server/game instead of localhost.5732.