How to configure Nginx as a reverse proxy for Sapho Server running on Apache Tomcat

Last update:

Audience: System administrators installing and configuring Sapho Server

This is Step-by-step guide for Ubuntu/Debian and CentOS based operating systems and these steps may vary slightly depending on your configuration and environment.

Step 1: Install Nginx

On Ubuntu/Debian

sudo apt-get install -y nginx

CentOS based distributions

sudo yum install -y nginx

Step 2: Configure Nginx

  1. Download to
  2. Open tomcat.conf and replace with proper values*:
    {{ nginx_server_name }}
    {{ nginx_ssl_cert_name }}
    {{ nginx_ssl_cert_key }}
  3. If you are installing Nginx on a server other than the one Sapho/Tomcat is on, then also update this directive as needed:
  4. Restart Nginx:
    sudo service nginx restart

* for SSL Certificate Installation in Nginx see the how to by DigiCert.

If you would like to restrict access to the builder tool via source IP (in this example, CIDR, you can add the following (into the same Nginx config file you set up above):

location ~ ^/(admin) {
   deny all;