From 4b14bf79c0c66c4cecc9ee500aff378b257b6b6c Mon Sep 17 00:00:00 2001 From: CryptoTitan Date: Mon, 16 Dec 2024 12:20:18 +0100 Subject: [PATCH] Update default.conf --- src/default.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/default.conf b/src/default.conf index 0a9dd11..49eccf9 100644 --- a/src/default.conf +++ b/src/default.conf @@ -13,6 +13,11 @@ server { set_real_ip_from 0.0.0.0/0; # Replace with Traefik's IP range if known real_ip_header X-Forwarded-For; + # Redirect HTTP to HTTPS if forwarded by Traefik + if ($http_x_forwarded_proto = 'https') { + return 301 https://$host$request_uri; + } + # Location block to pass PHP scripts to FastCGI (PHP-FPM) server location ~ \.php$ { try_files $uri =404;