Do not HTTPS redirect Let'sEncrypt ACME challenge

This commit is contained in:
Daniel Carrera 2020-06-25 18:35:15 -04:00
parent 5108e8e313
commit 2d860b04fc

View file

@ -514,7 +514,18 @@ server {
include /etc/nginx/vhost.d/default; include /etc/nginx/vhost.d/default;
{{ end }} {{ end }}
return 301 http://{{ $first_host }}$request_uri; # Do not HTTPS redirect Let'sEncrypt ACME challenge
location /.well-known/acme-challenge/ {
auth_basic off;
allow all;
root /usr/share/nginx/html;
try_files $uri =404;
break;
}
location / {
return 301 https://{{ $first_host }}$request_uri;
}
} }
{{ if (and (not $is_https) (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }} {{ if (and (not $is_https) (exists "/etc/nginx/certs/default.crt") (exists "/etc/nginx/certs/default.key")) }}