Do not HTTPS redirect Let'sEncrypt ACME challenge
This commit is contained in:
parent
5108e8e313
commit
2d860b04fc
1 changed files with 12 additions and 1 deletions
13
nginx.tmpl
13
nginx.tmpl
|
@ -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")) }}
|
||||||
|
|
Loading…
Reference in a new issue