Skip to content

Instantly share code, notes, and snippets.

@jlm
Created August 13, 2018 15:02
Show Gist options
  • Save jlm/f415ce4c99880dead9342b78dfefef53 to your computer and use it in GitHub Desktop.
Save jlm/f415ce4c99880dead9342b78dfefef53 to your computer and use it in GitHub Desktop.
Patch nginx.tmpl from jwilder/nginx-proxy and JrCs/docker-letsencrypt-nginx-proxy-companion to allow expired certificates to renew
--- nginx.tmpl 2017-12-29 08:56:32.000000000 -0700
+++ nginx.tmpl 2017-12-29 08:56:32.000000000 -0700
@@ -193,7 +193,18 @@
listen [::]:80 {{ $default_server }};
{{ end }}
access_log /var/log/nginx/access.log vhost;
- return 301 https://$host$request_uri;
+
+ 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 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment