dynmap通过mod_proxy在外部networking服务器上

好的,我知道当我提出一个与“我的世界”有关的问题时,我冒着大量的失望。 如果在这个问题上有任何格式错误(我这里是你的第一个问题),我要求提前原谅。 我也花了10多个小时尝试和谷歌search,但我找不到任何解决我面临的问题。 但在这里呢:

我的设置包含两台服务器,一台用于托pipe网站,另一台用于完成繁重的工作(例如“我的世界”)。 我使用Spigot为一些插件供电,其中一个插件是dynmap(这是一个用于在线显示世界和玩家的交互式地图)。 有关dynmap的更多信息在这里: https : //github.com/webbukkit/dynmap

无论如何,我想在我的web服务器上使用ReverseProxy,并且代理dynmap内容,这样我就可以closures路由器上的一些端口。 目前我刚刚在端口8123上向我的Minecraft服务器做了端口转发。

在webbserver上,我正在运行apache2.4,并且已经安装了mod_proxy和mod_proxy_html。 我也在HTTP和HTTPS的vhost文件中定义了这个:

ProxyRequests off ProxyPass "/map" "http://192.168.2.31:8123/" ProxyPassReverse "/map" "http://192.168.2.31:8123/" 

这应该是相当自我解释。 但是当我访问页面[WEBSITE] /地图,我迎接一个白色的空白页面。 我得到这个你:

 <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> 

本网站的全部function需要启用JavaScript。 以下是如何在您的网页浏览器中启用JavaScript的说明。

 <div id="mcmap"></div> 

我也在dynmapconfiguration中将web服务器定义为“受信任的代理”。 所以我的猜测是JavaScript或图片被封锁? 未安装mod_security。

提前致谢。

编辑链接显示为404,我应该propably在代理中添加子链接 404

编辑2

好吧,所以我在vhostconfiguration文件中添加了thoose行,现在我得到的错误要less得多,那就是一些东西。

  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/" 

我仍然试图找出为什么服务器不会发送位于/(见图片)下的.js文件。 在这里输入图像说明

编辑3

好吧,这很奇怪。 但是,如果我删除这样的最后一个反斜杠,我没有得到目录/独立的-js文件上的404。

  ProxyPass "/standalone" "http://192.168.2.31:8123/standalone" ProxyPassReverse "/standalone" "http://192.168.2.31:8123/standalone" 

在这里输入图像说明

我会保持这个更新。 想法是赞赏!

编辑4

好的,至less有一些进展。 编辑像我以前编辑过的线条,确实给了我更多的404,但是这一次是来自于瓷砖和图像。 所以这很好。

  ProxyPass "/up/configuration" "http://192.168.2.31:8123/up/configuration" ProxyPassReverse "/up/configuration" "http://192.168.2.31:8123/up/configuration" 

您应该确实检查代理请求的URI映射规则。 总的来说,更喜欢<Location>来处理代理内容。 还请注意Apache中的ProxyPassReverse指令以及其Web资源位置的dynmapconfiguration。 默认情况下,它使用相对path,所以你应该做的就是

<Location "/map/"> ProxyPass http://192.168.2.31:8123/ </Location>请注意,在这种configuration中,您的地图将取决于正在联机的服务器。

好吧,经过几个小时的反复试验。 和很多不同的眼睛,看了一下,我终于想出了这样的configuration:

  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" ProxyPass "/up/configuration" "http://192.168.2.31:8123/up/configuration" ProxyPass "/version.js" "http://192.168.2.31:8123/version.js" ProxyPass "/images" "http://192.168.2.31:8123/images/" ProxyPass "/tiles/world/t" "http://192.168.2.31:8123/tiles/world/t" ProxyPass "/tiles/world/t_day" "http://192.168.2.31:8123/tiles/world/t_day" ProxyPass "/tiles/world_nether/nt" "http://192.168.2.31:8123/tiles/world_nether/nt" ProxyPass "/tiles/world_nether/flat" "http://192.168.2.31:8123/tiles/world_nether/flat" ProxyPass "/tiles/world_the_end/st" "http://192.168.2.31:8123/tiles/world_the_end/st" ProxyPass "/up/world/world" "http://192.168.2.31:8123/up/world/world" ProxyPass "/up/world/world_nether" "http://192.168.2.31:8123/up/world/world_nether" ProxyPass "/up/world/world_the_end" "http://192.168.2.31:8123/up/world/world_the_end" ProxyPass "/mapimages" "http://192.168.2.31:8123/mapimages/" ProxyPass "/tiles/_markers_" "http://192.168.2.31:8123/tiles/_markers_" ProxyPass "/tiles/faces/16x16" "http://192.168.2.31:8123/tiles/faces/16x16" ProxyPass "/tiles/faces/32x32" "http://192.168.2.31:8123/tiles/faces/32x32" 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" ProxyPassReverse "/up/configuration" "http://192.168.2.31:8123/up/configuration" ProxyPassReverse "/version.js" "http://192.168.2.31:8123/version.js" ProxyPassReverse "/images" "http://192.168.2.31:8123/images/" ProxyPassReverse "/tiles/world/t" "http://192.168.2.31:8123/tiles/world/t" ProxyPassReverse "/tiles/world/t_day" "http://192.168.2.31:8123/tiles/world/t_day" ProxyPassReverse "/tiles/world_nether/nt" "http://192.168.2.31:8123/tiles/world_nether/nt" ProxyPassReverse "/tiles/world_the_end/st" "http://192.168.2.31:8123/tiles/world_the_end/st" ProxyPassReverse "/up/world/world" "http://192.168.2.31:8123/up/world/world" ProxyPassReverse "/up/world/world_nether" "http://192.168.2.31:8123/up/world/world_nether" ProxyPassReverse "/up/world/world_the_end" "http://192.168.2.31:8123/up/world/world_the_end" ProxyPassReverse "/mapimages" "http://192.168.2.31:8123/mapimages/" ProxyPassReverse "/tiles/_markers_" "http://192.168.2.31:8123/tiles/_markers_" ProxyPassReverse "/tiles/faces/16x16" "http://192.168.2.31:8123/tiles/faces/16x16" ProxyPassReverse "/tiles/faces/32x32" "http://192.168.2.31:8123/tiles/faces/32x32" 

这是有效的(在我的情况下),但是我知道如果目录结构发生变化,我必须重新定义所有的规则。 一切正常,我应该用这个configuration。

只要改变世界名称,如果你是不同的。

我也build议任何读者尝试“AnrDaemons”的build议