From f0e154261582d1565fa40be5bb6c27d591ff9b79 Mon Sep 17 00:00:00 2001 From: mathilde-cryptpad <156299270+mathilde-cryptpad@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:59:55 +0200 Subject: [PATCH] add support for HTTP -> HTTPS (80 -> 443 ports) redirection, necessary for Let's Encrypt TLS certificate renewals --- docs/example-advanced.nginx.conf | 15 +++++++++++++++ docs/example.nginx.conf | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/docs/example-advanced.nginx.conf b/docs/example-advanced.nginx.conf index 556829935..00bec9369 100644 --- a/docs/example-advanced.nginx.conf +++ b/docs/example-advanced.nginx.conf @@ -8,6 +8,21 @@ # installation (http server by the Nodejs process). If you are using CryptPad # in production and require professional support please contact sales@cryptpad.fr +server { + listen 80; + listen [::]:80; + server_name your-main-domain.com your-sandbox-domain.com; + + access_log /dev/null; + error_log /dev/null emerg; + + # Let's Encrypt webroot + include letsencrypt-webroot; + + # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. + return 301 https://$host$request_uri; +} + server { listen 443 ssl; listen [::]:443 ssl; diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index dd61615a1..eae30310a 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -8,6 +8,21 @@ # installation (http server by the Nodejs process). If you are using CryptPad # in production and require professional support please contact sales@cryptpad.fr +server { + listen 80; + listen [::]:80; + server_name your-main-domain.com your-sandbox-domain.com; + + access_log /dev/null; + error_log /dev/null emerg; + + # Let's Encrypt webroot + include letsencrypt-webroot; + + # Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response. + return 301 https://$host$request_uri; +} + server { listen 443 ssl; listen [::]:443 ssl;