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

**URL:** https://community.savapage.org/t/what-software-to-use-as-reverse-proxy-for-the-use-of-port-80-and-443-for-savapage/54
**Category:** Deployment
**Created:** [April 4, 2019, 3:21pm UTC](https://community.savapage.org/t/what-software-to-use-as-reverse-proxy-for-the-use-of-port-80-and-443-for-savapage/54 "2019-04-04T15:21:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![erik](https://community.savapage.org/letter_avatar_proxy/v4/letter/e/b5ac83/32.png) [@erik](https://community.savapage.org/u/erik)
#### Post date: [April 4, 2019, 3:21pm UTC](https://community.savapage.org/t/what-software-to-use-as-reverse-proxy-for-the-use-of-port-80-and-443-for-savapage/54/1 "2019-04-04T15:21:51Z")

</div>

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;

    }
  }
```

---

<div class="post-metadata">

### Author: ![chris](https://community.savapage.org/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://community.savapage.org/u/chris)
#### Post date: [April 6, 2019, 9:30am UTC](https://community.savapage.org/t/what-software-to-use-as-reverse-proxy-for-the-use-of-port-80-and-443-for-savapage/54/2 "2019-04-06T09:30:28Z")

</div>

![image](https://community.savapage.org/uploads/default/original/1X/ae0a15d281164512824a2505ae04ba79e2dfb09f.jpeg)  
 ![image](https://community.savapage.org/uploads/default/original/1X/f0a0a12fb9ab6ad317e6bf508aee2bd8125f8e6c.png)

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

---

<div class="post-metadata">

### Author: ![rijkr](https://community.savapage.org/user_avatar/community.savapage.org/rijkr/32/3_2.png) [@rijkr](https://community.savapage.org/u/rijkr)
#### Post date: [April 8, 2019, 7:57am UTC](https://community.savapage.org/t/what-software-to-use-as-reverse-proxy-for-the-use-of-port-80-and-443-for-savapage/54/3 "2019-04-08T07:57:59Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![thoschi](https://community.savapage.org/letter_avatar_proxy/v4/letter/t/58f4c7/32.png) [@thoschi](https://community.savapage.org/u/thoschi)
#### Post date: [June 19, 2024, 3:09pm UTC](https://community.savapage.org/t/what-software-to-use-as-reverse-proxy-for-the-use-of-port-80-and-443-for-savapage/54/4 "2024-06-19T15:09:28Z")

</div>

As this has changed in actual versions of nginx:

`ssl on;`

is deprecated and should be replaced by changing the listen-directive to

`listen 443 ssl;`

Source: [Module ngx\_http\_ssl\_module](http://nginx.org/en/docs/http/ngx_http_ssl_module.html)
