MapTiler Server behind Nginx with HTTPS

If you have not yet installed the MapTiler Server, follow this guide first.

MapTiler Server is designed to run without any external dependency, so it can be directly accessible from the internet. In some cases, it might be beneficial to put a reverse proxy (such as Nginx or Apache) in front. It is useful especially if you want to set up additional security measures, HTTPS, serve multiple services on a single machine, load-balancing, rate-limiting, or other advanced features.

Integration of MapTiler Server into existing Nginx installation can be done based on the official Nginx Setting Up a Simple Proxy Server guide.

You also need to remember to set up the forwarding of X-Forwarded-* headers from Nginx to MapTiler Server.

This ensures that the MapTiler Server knows the address where it is accessible from outside and can construct absolute URLs to itself.

If you configure HTTPS on your nginx - be sure to also set the X-Forwarded-Proto to https, otherwise just keep it on http or default $http_x_forwarded_proto (or don’t set this particular header at all).

The basic Nginx configuration can look somehow like this (in case you serve over https from nginx):

server {  
  listen 80;  
  server_name maps.mycompany.com;  
    
  location / {  
     proxy_set_header X-Forwarded-Host maps.mycompany.com;  
     proxy_set_header X-Forwarded-Proto https;  
     proxy_pass <http://127.0.0.1:3650;>  
  }  
}  

This should be enough to get started. If you have the MapTiler Server running and the domain is properly pointed to your server, the maps should now be accessible at https://maps.mycompany.com/ 
and administration at [https://maps.mycompany.com/admin](http://maps.mycompany.com/admin)

Configure HTTPS
Set up content caching
Set up rate-limiting
Restrict access with authentication
HTTP Load Balancing.