Dynmap-Forge/Fabric

Dynmap-Forge/Fabric

888k Downloads

Can't get web interface working with Pterodactyl and nginx proxy_pass setup

SamusAranX opened this issue ยท 1 comments

commented

Issue Description:

Because the current state of dynmap's web ui documentation is a mess and my setup (2 physical servers, one being the main server running Pterodactyl and the other being the game server running Minecraft) is seemingly not used by anyone else, I tried setting it up myself.

The servers are in the same DC and are networked together. Because of this, I installed nginx and php-fpm 7.3 on the game server and configured that nginx instance like this:

server {
	listen 10.0.0.2:80;
	server_name _;

	root /var/lib/pterodactyl/volumes/897ea544-4776-4e44-933c-99c8934487b0/plugins/dynmap/web;
	index index.php index.html index.htm;

	autoindex on;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

	# pass PHP scripts to FastCGI server
	#
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;

		# With php-fpm (or other unix sockets):
		fastcgi_pass unix:/run/php/php7.3-fpm.sock;
	}
}

On the main server, I have an nginx server block like this:

server {
	# <listen/ssl directives>

	server_name minecraftmaps.example.com;

	location / {
		proxy_set_header Host $http_host;
		proxy_redirect off;
		proxy_pass http://10.0.0.2;
	}
}

As you can see, I simply pointed the nginx instance on the game server directly at the web directory in the minecraft server's dynmap directory and instructed the main server's nginx instance to proxy all requests to the game server.

Now, on maps.example.com, I get a black page. More specifically, the server correctly serves all files except one and based on absolutely no further research, I believe this causes the page to not render:
image
The page tries loading config.js from this URL: https://minecraftmaps.example.com/standalone/config.js?_=3.1-beta4-421 which makes no sense, as the standalone directory only contains a bunch of PHP files. There's a config.js one level above, but it's empty:

// This file is retired : settings now can be tailored using url section in configuration.txt, when needed
//

Is there any way to make this work? If all dynmap does is generate a bunch of tiles for the otherwise static website, this should work, right?
By the way, for various boring technical reasons, it's not possible to use dynmap's built-in web server for this.

  • Dynmap Version: dynmap 3.1-beta4-421
  • Server Version: Paper 1.16.3
  • Pastebin of Configuration.txt: https://pastebin.com/xnALeAGC
  • Server Host (if applicable): self-hosted
  • Steps to Replicate: See above

[x] I have looked at all other issues and this is not a duplicate
[x] I have been able to replicate this

commented

Never mind. I managed to work around the aforementioned boring technical reasons and got it working with a combination of dynmap's built-in web server and an nginx proxy.