From 9aa2d310f88dd625fa6e1e3a55152a69b715aca8 Mon Sep 17 00:00:00 2001 From: rockstardev <5191402+rockstardev@users.noreply.github.com> Date: Wed, 30 Apr 2025 14:12:21 -0500 Subject: [PATCH] Not redirecting acme-challange url --- Production/nginx.tmpl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Production/nginx.tmpl b/Production/nginx.tmpl index 6a1b926..b2bca24 100644 --- a/Production/nginx.tmpl +++ b/Production/nginx.tmpl @@ -514,7 +514,19 @@ server { listen [::]:80 {{ $default_server }}; {{ end }} access_log /var/log/nginx/access.log vhost; - return 301 https://$host$request_uri; + + # Allow acme challenge requests without redirect + location ^~ /.well-known/acme-challenge/ { + allow all; + root /usr/share/nginx/html; + try_files $uri =404; + break; + } + + # Redirect all other requests to HTTPS + location / { + return 301 https://$host$request_uri; + } } {{ end }}