mirror of
https://github.com/thib8956/nginx-proxy
synced 2024-11-22 03:46:29 +00:00
Do not HTTPS redirect Let'sEncrypt ACME challenge
The auto renewal of Let'sEncrypt certificates fails due to the HTTPS redirect of the ACME challenge. This workaround resolves the issue: https://gist.github.com/codekitchen/2c519eb7572002afab6a5f979cd42913#file-letsencrypt-diff Found through this comment: https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion/issues/526#issuecomment-476253642
This commit is contained in:
parent
4443ee8b5a
commit
11d644d645
14
nginx.tmpl
14
nginx.tmpl
@ -246,7 +246,19 @@ server {
|
|||||||
listen [::]:80 {{ $default_server }};
|
listen [::]:80 {{ $default_server }};
|
||||||
{{ end }}
|
{{ end }}
|
||||||
access_log /var/log/nginx/access.log vhost;
|
access_log /var/log/nginx/access.log vhost;
|
||||||
return 301 https://$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://$host$request_uri;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user