What software to use as reverse proxy for the use of port 80 and 443 for SavaPage?

There are enough reverse proxy applications to choose from. The two best known options are Apache and Nginx. In my humble opinion, Nginx is a much better choice for using reverse proxy with SavaPage than Apache.

Nginx was made to be a reverse proxy. Initially all it did was serve static files and reverse proxy to a backend server via HTTP/1.0. Since that time fastcgi, load balancing and various other features has been added to it. But it’s initial design purpose was to serve static files and reverse proxy and it does this very well.

Nginx is ‘event-based’, while apache is ‘process-based’. When your SavaPage server has a lot of users, this makes all the difference in the world. Apache has to fork or start a new thread for each connection, while Nginx doesn’t. This difference shows up mainly in memory usage, but also in user response time and other performance metrics.

Apache, on the contrary, is a general purpose web server. The reverse proxy works perfectly fine, but it was not designed to have a minimal memory footprint and as a result it requires more resources than Nginx does.

But keep in mind that Apache supports a larger toolbox of things it can do immediately and is the most compatible across all web software out there today.

A basic configuration example for Nginx reverse proxy with https for SavaPage:

server {
    listen 80;
    return 301 https://$host$request_uri;
}

server {

    listen 443;
    server_name savapage.example.com;

    ssl_certificate           /etc/nginx/cert.crt;
    ssl_certificate_key       /etc/nginx/cert.key;

    ssl on;
    ssl_session_cache  builtin:1000  shared:SSL:10m;
    ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
    ssl_prefer_server_ciphers on;

    access_log            /var/log/nginx/reverseproxy.access.log;

    location / {

      proxy_set_header        Host $host;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;

      proxy_pass          http://localhost:8631;
      proxy_read_timeout  90;

    }
  }
2 Likes


The graphs show that nginx uses less memory and can handle more connections under stress.

1 Like

Thanks @erik and @chris : great posts. The graphs speak for themselves. For a dedicated SavaPage host Nginx is obvious the better choice. In case anyone is interested in the details behind the graphs, can you give the links?