Fix SSL certificate renewal for Let's Encrypt

Allow ACME challenge requests before HTTPS redirect:
- Add location block for /.well-known/acme-challenge/
- Prevent immediate redirect that was blocking Let's Encrypt verification
- Fixes 'Timeout during connect' errors during certbot renewal
This commit is contained in:
2025-11-15 22:30:01 +01:00
parent 9aa881d895
commit 059daa77aa

View File

@@ -5,8 +5,15 @@ server {
listen 80 default_server; listen 80 default_server;
server_name ak-homelab.duckdns.org _; server_name ak-homelab.duckdns.org _;
# Redirect HTTP to HTTPS # Allow Let's Encrypt ACME challenges
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# Redirect all other HTTP to HTTPS
location / {
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
}
} }
server { server {