diff --git a/config/nginx/homelab.conf b/config/nginx/homelab.conf index ff2b064..b12f36e 100644 --- a/config/nginx/homelab.conf +++ b/config/nginx/homelab.conf @@ -4,9 +4,16 @@ server { listen 80 default_server; server_name ak-homelab.duckdns.org _; - - # Redirect HTTP to HTTPS - return 301 https://$host$request_uri; + + # 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; + } } server {