Skip to content

Commit 303f264

Browse files
Merge pull request #486 from p-rintz/nginx-config
Add nginx example reverse proxy config
2 parents 87e702b + 78b8527 commit 303f264

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,63 @@ Find below a minimal example of an Apache2 vhost to work as a reverse proxy with
342342
```
343343
</details>
344344

345+
<details><summary>Nginx</summary>
346+
347+
Below is a simple, but complete example of a Nginx reverse proxy config for ESS Community with TLS termination.
348+
```
349+
server {
350+
listen 443 ssl http2;
351+
listen [::]:443 ssl http2;
352+
353+
access_log /var/log/nginx/ess.log main;
354+
error_log /var/log/nginx/ess.errors;
355+
356+
ssl_certificate /etc/nginx/certs/certificate.full;
357+
ssl_certificate_key /etc/nginx/certs/certificate.key;
358+
359+
#TLSv1.2 is required for iOS support for now
360+
ssl_protocols TLSv1.2 TLSv1.3;
361+
ssl_dhparam /etc/nginx/dhparam.pem;
362+
ssl_session_cache shared:le_nginx_SSL:10m;
363+
ssl_session_timeout 1440m;
364+
ssl_session_tickets off;
365+
ssl_buffer_size 4k;
366+
ssl_stapling on;
367+
ssl_stapling_verify on;
368+
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload' always;
369+
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305;
370+
ssl_prefer_server_ciphers on;
371+
372+
server_name chat.example.com matrix.example.com account.example.com mrtc.example.com;
373+
374+
location / {
375+
proxy_pass http://127.0.0.1:8080;
376+
proxy_set_header X-Forwarded-For $remote_addr;
377+
proxy_set_header X-Forwarded-Proto $scheme;
378+
proxy_set_header Host $host;
379+
380+
client_max_body_size 50M;
381+
382+
proxy_http_version 1.1;
383+
proxy_set_header Upgrade $http_upgrade;
384+
proxy_set_header Connection "upgrade";
385+
386+
proxy_read_timeout 86400s;
387+
proxy_send_timeout 86400s;
388+
proxy_buffering off;
389+
}
390+
}
391+
392+
server {
393+
listen 80;
394+
listen [::]:80;
395+
server_name chat.example.com matrix.example.com account.example.com mrtc.example.com;
396+
return 301 https://$host$request_uri;
397+
}
398+
399+
```
400+
</details>
401+
345402
### Configuring the database
346403

347404
You can either use the database provided with ESS Community or you use a dedicated PostgreSQL Server. We recommend [using a PostgreSQL server](./docs/advanced.md#using-a-dedicated-postgresql-database) installed with your own distribution packages. For a quick set up, feel free to use the internal PostgreSQL database. The chart will configure it automatically for you by default.

newsfragments/486.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add example config for Nginx reverse proxy.

0 commit comments

Comments
 (0)