From 8d8e5f6998c51c8fe7e2e5f488123b4231d5ff4a Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Wed, 3 Jun 2020 18:24:40 +0200 Subject: [PATCH] certbot: restore compatibility with old Nginx --- CHANGELOG.md | 2 ++ certbot/templates/acme-challenge/nginx.conf.j2 | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a92ddc8c..53feb52e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ The **patch** part changes incrementally at each release. ### Fixed +* certbot: restore compatibility with old Nginx + ### Removed ### Security diff --git a/certbot/templates/acme-challenge/nginx.conf.j2 b/certbot/templates/acme-challenge/nginx.conf.j2 index a0730f3c..e4d3244b 100644 --- a/certbot/templates/acme-challenge/nginx.conf.j2 +++ b/certbot/templates/acme-challenge/nginx.conf.j2 @@ -1,5 +1,9 @@ location ~ /.well-known/acme-challenge { +{% if ansible_distribution == "Debian" and ansible_distribution_major_version is version('8', '<=') %} + alias {{ certbot_work_dir }}/.well-known/acme-challenge; +{% else %} alias {{ certbot_work_dir }}/; +{% endif %} try_files $uri =404; allow all; }