Last active
June 7, 2020 19:32
-
-
Save codekitchen/2c519eb7572002afab6a5f979cd42913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jwilder/nginx-proxy | |
COPY *.conf /etc/nginx/conf.d/ | |
COPY letsencrypt.diff /app/ | |
RUN apt-get update && apt-get install -y \ | |
patch \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN patch nginx.tmpl letsencrypt.diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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
This worked for me too. Thanks! :)
I had to comment out the
COPY *.conf /etc/nginx/conf.d/
line in the suggestedDockerfile
and also decided to make adocker-compose.yml
:Hope it helps anyone.
I made a PR to add this to jwilder/nginx-proxy: nginx-proxy/nginx-proxy#1338
PS @codekitchen You made it because of this: nginx-proxy/acme-companion#299