From 7f7079db9e5c7c6c4dada8cd5eda207d595f872e Mon Sep 17 00:00:00 2001 From: HgO Date: Sat, 26 Dec 2020 14:40:54 +0100 Subject: [PATCH] fix nginx acme challenge location --- templates/nginx.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/nginx.conf.j2 b/templates/nginx.conf.j2 index 106a3a4..60dda9e 100644 --- a/templates/nginx.conf.j2 +++ b/templates/nginx.conf.j2 @@ -8,10 +8,10 @@ server { return 301 https://$host$request_uri; } -{% if acme_enabled and acme_challenge_dir is defined %} +{% if acme_enabled %} location ^~ /.well-known/acme-challenge/ { allow all; - root {{ acme_challenge_dir }}; + alias {{ acme_config.challenge_dir + (acme_config.challenge_dir.endswith('/') | ternary('', '/')) }}; try_files $uri =404; } {% endif %}