-
-
Notifications
You must be signed in to change notification settings - Fork 4
Internal, External and Reverse Proxy Web Servers
Pl3xMap ships with an internal web server that comes all the bells and whistles you'll need to get your map online and sharable. See the config for it here.
The default address to bind to is 0.0.0.0
which binds to all interfaces the machine is assigned to. Do not set this to your server's public IP or domain! This should not be changed if you don't know what it does.
The default port is 8080. Ensure the port you use is open to outside internet connections so others can access the map. You can set it to port 80
if no other services are using it, which will allow users to use the map without specifying a port in the address bar.
By default, the internal web server is enabled for your convenience.
If you need more advanced features, such as SSL, you'll need to use an external web server or a reverse proxy.
Some users may want to disable the internal web server to use their own external web server.
If your external web server can't access Pl3xMap's tiles, you can set up a reverse proxy. Otherwise, follow this section to route all traffic through an external web server.
This guide is written for Debian-based operating systems. However, much of it still applies for Linux-based operating systems.
Before you begin, ensure you have:
- root/sudo access on the machine
- a Linux distro with
apt
(Debian, Ubuntu, etc.) - TCP ports
80
and/or443
available and open - already ran Pl3xMap once with the internal web server enabled
- the Minecraft server is currently offline
There are specific sections for a variety of web servers.
<VirtualHost *:80>
ServerName example.com
ServerAdmin [email protected]
DocumentRoot "/var/www/"
<Directory "/var/www/">
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride All
Require all granted
</Directory>
<FilesMatch "(\.gz)$">
Header set Content-Encoding gzip
Header append Vary Accept-Encoding
</FilesMatch>
</VirtualHost>
This part of the guide will show you how to serve the map with NGINX without a reverse proxy.
First install NGINX and go through the initial setup.
Then copy the files from the default Pl3xMap web directory (plugins/Pl3xMap/web
) to the web server's web root directory (/var/www/<YOUR_DOMAIN>
)
You can do this by creating a symlink from the Pl3xMap web directory to this folder or by copying the files and updating the path in Pl3xMap's config.
Use this snippet for your website-config:
server {
listen 80; # listens on port 80
listen [::]:80; # listen to all addresses on port 80
server_name <YOUR_DOMAIN>; # the name (domain) of the server
root /var/www/<YOUR_DOMAIN>; # sets the root dir
index index.html; # the index file name
# Pl3xMap uses statically compressed files for extensive data
location ^~ \.gz$ {
gzip off; # Ensure nginx doesn't double-compress
add_header Content-Encoding gzip;
}
}
This will create a new site config for Pl3xMap. As usual, replace <YOUR_DOMAIN>
with your domain.
Restart NGINX and start your Minecraft server, make sure everything is running correctly.
Navigating to https://<YOUR_DOMAIN>/
should now show you the map!
After you've completed this, follow Enabling SSL.
This part of the guide will show you how to serve the map with Caddy without a reverse proxy.
First install Caddy and go through the initial setup: https://caddyserver.com/docs/, make sure to setup a caddyfile.
Add this snippet to your caddyfile:
<YOUR_DOMAIN>
root * </path/to/plugins/Pl3xMap/web>
file_server
@gz {
path *.gz
}
handle @gz {
header Content-Encoding gzip
}
This will create a new site config for Pl3xMap. As usual, replace <YOUR_DOMAIN>
with your domain.
This will tell Caddy:
- What domain it should use.
- The folder where it should look for your files
- And finally how it should handle a few of Pl3xmap's special compressed files
Reload your caddyfile, navigating to https://<YOUR_DOMAIN>/
should now show you the map!
Caddy will automatically handle the HTTPS authentication for your webpage, no need to setup SSL yourself!
"A reverse proxy is a server that sits in front of one or more web servers, intercepting requests from clients."
- Cloudflare
This route will allow the use of a domain and existing web server without modifying Pl3xMap's internal web server.
Before you begin, ensure you have:
- root/sudo access on the machine
- a Linux distro with
apt
(Debian, Ubuntu, etc.) - TCP ports
80
and443
available and open - Pl3xMap's internal server enabled and functional
There are specific sections for a variety of web servers.
This part of the guide will show you how to serve the map with NGINX with a reverse proxy.
First install NGINX and go through the initial setup.
Use this snippet for your website-config:
server {
listen 80; # listens on port 80
listen [::]:80; # listen to all addresses on port 80
server_name <YOUR_DOMAIN>; # the name of the server
location / {
proxy_pass http://<MAP_IP>:<MAP_PORT>; # reverse proxy to Pl3xMap instance
}
}
This will create a new site config for Pl3xMap. As usual replace anything within angle brackets < >
to the values that apply to you.
Start your Minecraft server, make sure Pl3xMap's internal server is running.
Navigating to https://<YOUR_DOMAIN>/
should now show you the map!
After you've completed this, follow Enabling SSL.
This part of the guide will show you how to serve the map with Caddy with a reverse proxy.
First install caddy and go through the initial setup: https://caddyserver.com/docs/, make sure to setup a caddyfile.
Add this snippet to your caddyfile:
<YOUR_DOMAIN>
reverse_proxy 127.0.0.1:<pl3xmap_port>
This will create a new site config for Pl3xMap. As usual, replace <YOUR_DOMAIN>
with your own domain.
Reload your caddyfile & start your Minecraft server, make sure Pl3xMap's internal server is running.
Navigating to https://<YOUR_DOMAIN>/
should now show you the map!
Caddy will automatically handle the HTTPS authentication for your webpage, no need to setup SSL yourself!
This section assumes that you have:
- Successfully set up an external web server or reverse proxy.
SSL is important to keep the users accessing your site secure.
You can get a free SSL certificate by running the commands below:
$ sudo apt update
$ sudo apt install certbot
$ sudo certbot --<YOUR_WEBSERVER>
Replace <YOUR_WEBSERVER>
with the external web server you use. (apache
, nginx
, etc.)
Make sure to choose your domain/site and your preferred options during the installation. Wait for it to finish and SSL should be set up.
- Home
- Server Admins:
- Plugin Developers: