From ce72d0d17a81e27a3559a4a974e9a5fc80e2fb90 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Sat, 11 May 2024 19:13:04 +0000 Subject: [PATCH] nginx_site: Fix certbot virtual host --- roles/nginx_site/templates/site.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/nginx_site/templates/site.conf.j2 b/roles/nginx_site/templates/site.conf.j2 index fc70329..eaf21e4 100644 --- a/roles/nginx_site/templates/site.conf.j2 +++ b/roles/nginx_site/templates/site.conf.j2 @@ -54,6 +54,7 @@ server { listen 80; listen [::]:80; server_name {{ nginx_site_name }}; +{% if nginx_site_name != 'certbot.home.foo.sh' %} location /.well-known/acme-challenge/ { proxy_pass http://certbot.home.foo.sh/.well-known/acme-challenge/; } @@ -64,5 +65,8 @@ server { return 301 https://$host$request_uri; {% endif %} } +{% else %} + root /srv/web/{{ nginx_site_name }}; +{% endif %} } {% endif %}