My setup consist of two servers, one for hosting websites and one for doing the heavy lifting (for example Minecraft). I am using Spigot to power some plugins and one of the plugins is dynmap (which is a interactive map for showing the world and the players online). More information regarding the dynmap is here: https://github.com/webbukkit/dynmap
Anyway, I want to use a ReverseProxy on my web server and Proxy the dynmap content so I can close some ports on the router. Currently I have just made a Port forward on port 8123 to my Minecraft server.
On the web server I am currently running Apache 2.4 and I have installed mod_proxy and mod_proxy_html. I have also defined this in the vhost file for both HTTP and HTTPS:
ProxyRequests off
ProxyPass "/map" "http://192.168.2.31:8123/"
ProxyPassReverse "/map" "http://192.168.2.31:8123/"
This should be rather self explanatory. But when I access the page [WEBSITE]/map I am greeted with a white blank page. I am getting this though:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Minecraft Dynamic Map</title>
<meta charset="utf-8" />
<meta name="keywords" content="minecraft, map, dynamic" />
<meta name="description" content="Minecraft Dynamic Map" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<!-- These 2 lines make us fullscreen on apple mobile products - remove if you don't like that -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="icon" href="images/dynmap.ico" type="image/ico" />
<script type="text/javascript" src="js/jquery-1.11.0.js?_=2.3-2074"></script>
<link rel="stylesheet" type="text/css" href="css/leaflet.css?_=2.3-2074" />
<script type="text/javascript" src="js/leaflet.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/custommarker.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/dynmaputils.js?_=2.3-2074"></script>
<!--<link rel="stylesheet" type="text/css" href="css/embedded.css" media="screen" />-->
<link rel="stylesheet" type="text/css" href="css/standalone.css?_=2.3-2074" media="screen" />
<link rel="stylesheet" type="text/css" href="css/dynmap_style.css?_=2.3-2074" media="screen" />
<!-- <link rel="stylesheet" type="text/css" href="css/override.css" media="screen" /> -->
<script type="text/javascript" src="version.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/jquery.json.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/minecraft.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/map.js?_=2.3-2074"></script>
<script type="text/javascript" src="js/hdmap.js?_=2.3-2074"></script>
<script type="text/javascript" src="standalone/config.js?_=2.3-2074"></script>
<script type="text/javascript">
$(document).ready(function() {
window.dynmap = new DynMap($.extend({
container: $('#mcmap')
}, config));
});
</script>
</head>
<body>
<noscript>
For full functionality of this site it is necessary to enable JavaScript.
Here are the <a href="http://www.enable-javascript.com/" target="_blank">
instructions how to enable JavaScript in your web browser</a>.
</noscript>
<div id="mcmap"></div>
</body>
</html>
I have also defined the web server as "trusted proxy" in the dynmap config. So my guess is that JavaScript or pictures is blocked somehow? mod_security is not installed.
EDIT
The links appears as 404, I should propably add sublinks in the proxy
EDIT 2
Alright, so I added those lines into the vhost config, and now I am getting far less errors, that's something.
ProxyRequests off
ProxyPass "/map" "http://192.168.2.31:8123/"
ProxyPass "/js" "http://192.168.2.31:8123/js/"
ProxyPass "/js/minecraft" "http://192.168.2.31:8123/js/minecraft/"
ProxyPass "/js/map" "http://192.168.2.31:8123/js/map/"
ProxyPass "/css" "http://192.168.2.31:8123/css/"
ProxyPass "/standalone" "http://192.168.2.31:8123/standalone/"
ProxyPassReverse "/map" "http://192.168.2.31:8123/"
ProxyPassReverse "/js" "http://192.168.2.31:8123/js/"
ProxyPassReverse "/js/minecraft""http://192.168.2.31:8123/js/minecraft/"
ProxyPassReverse "/js/map" "http://192.168.2.31:8123/js/map/"
ProxyPassReverse "/css" "http://192.168.2.31:8123/css/"
ProxyPassReverse "/standalone" "http://192.168.2.31:8123/standalone/"
I am still trying to figure out why the servers does'nt send me the .js files that are located under / (see picture)
EDIT 3
Alright, this is rather strange. But if I remove the last backslash like this, I am not getting a 404 on the -js file in the catalogue /standalone.
ProxyPass "/standalone" "http://192.168.2.31:8123/standalone"
ProxyPassReverse "/standalone" "http://192.168.2.31:8123/standalone"
EDIT 4
Alright, some progress at least. Editing those lines like I did on previous edit did give me a lot of more 404, but this time it was from the tiles and images. So that is good.
ProxyPass "/up/configuration" "http://192.168.2.31:8123/up/configuration"
ProxyPassReverse "/up/configuration" "http://192.168.2.31:8123/up/configuration"