{"date": "2020-09-23", "tags": "minecraft, nginx, gnu/linux", "type": "post"}

minecraft dynmap reverse proxy

This is a 5 minute read how to configure a reverse proxy for your dynmap to make your Minecraft experience way better. You can see your map in 2d/3d. You can see your friends and builds. I think it is the best plugin made for this game.

2020-01-29_15.51.01

  1. Install dynmap, in other words put newest dynmap.jar into your plugins/ directory within server directory. I assume you are running a spigot based server. If you are not running PaperMC, I suggest you to do it.

  2. Start/restart your Minecraft server.

  3. Create a new website for nginx. Standard procedure is to create a config file in available sites directory and create a link to it in enabled sites.

    $ sudo nano /etc/nginx/sites-available/dynmap.conf
    
  4. Setup your reverse proxy. In my case, I run reverse proxy on a different server, so I am routing to the ip address of the server, not the localhost. If you are running nginx on the same machine, use 127.0.0.0:8123 instead. 8123 is the default port of dynmap.

    server {
    # Give the address you will type in the browser with www and without.
    server_name map.yourdomain.com www.map.yourdomain.com;
    
    location / {
           # Address of your dynmap front-end.
           # This is not the real ip of my minecraft vps :)
        proxy_pass         http://185.30.189.1:8123/;
    }
    }
    
  5. Link it to enabled sites.

    $ sudo ln -s /etc/nginx/sites-available/dynmap.conf /etc/nginx/sites-enabled/
    
  6. Install and run certbot for nginx, which will handle the SSL configuration for you. It will ask you to pick which sites you want to enable the encryption for.

    $ sudo apt install certbot
    $ sudo certbot --nginx
    
  7. Restart nginx.

    $ sudo systemctl restart nginx
    
  8. You should be able to access dynmap via the domain you assigned in configuration file. It should also have https working. This assumes that you have working nginx configuration with your domain pointing to the server running nginx. If you do not, go to the admin panel of your domain and redirect it to the ip address of your server meant to run nginx.

Screenshot from 2020-09-23 23-22-03