From a77fc2bde4db1f695035846947ba6205c9807be9 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Mon, 23 Mar 2020 00:27:35 +0100 Subject: [PATCH] Redirect all HTTP to HTTPS. --- buster/etc_files/web/etc/nginx/nginx.conf | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/buster/etc_files/web/etc/nginx/nginx.conf b/buster/etc_files/web/etc/nginx/nginx.conf index 83092d6..1e9c0c2 100644 --- a/buster/etc_files/web/etc/nginx/nginx.conf +++ b/buster/etc_files/web/etc/nginx/nginx.conf @@ -30,20 +30,9 @@ http { include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; - # If we wanted a simple file server … - ## HTTP server: only enforce HTTPS - #server { - # listen 80; - # return 301 https://$host$request_uri; - #} - # - ## HTTPS server - #server { - # listen 443 ssl; - # server_name REPLACE_fqdn_ECALPER; - # ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem; - # ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem; - # root /var/www/html/; - # index index.html index.htm index.nginx-debian.html; - #} + # Redirect all HTTP requests to HTTPS. + server { + listen 80; + return 301 https://$host$request_uri; + } } -- 2.30.2