Skip to content

Commit

Permalink
Certbot renewal process code added
Browse files Browse the repository at this point in the history
  • Loading branch information
thecarlo committed Jun 19, 2018
1 parent d88e9ec commit 2f8e7b8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/letsencrypt/docker-compose.yml
Expand Up @@ -4,7 +4,7 @@ services:

letsencrypt-nginx-container:
container_name: 'letsencrypt-nginx-container'
image: nginx:latest
image: nginx:1.14.0
ports:
- "80:80"
volumes:
Expand Down
4 changes: 3 additions & 1 deletion src/production/docker-compose.yml
Expand Up @@ -4,7 +4,7 @@ services:

production-nginx-container:
container_name: 'production-nginx-container'
image: nginx:latest
image: nginx:1.14.0
ports:
- "80:80"
- "443:443"
Expand All @@ -14,6 +14,8 @@ services:
- ./dh-param/dhparam-2048.pem:/etc/ssl/certs/dhparam-2048.pem
- /docker-volumes/etc/letsencrypt/live/ohhaithere.com/fullchain.pem:/etc/letsencrypt/live/ohhaithere.com/fullchain.pem
- /docker-volumes/etc/letsencrypt/live/ohhaithere.com/privkey.pem:/etc/letsencrypt/live/ohhaithere.com/privkey.pem
#for certbot challenges
- /docker-volumes/data/letsencrypt:/data/letsencrypt
networks:
- docker-network

Expand Down
26 changes: 6 additions & 20 deletions src/production/production.conf
Expand Up @@ -3,15 +3,15 @@ server {
listen [::]:80;
server_name ohhaithere.com www.ohhaithere.com;

location ^~ /.well-known/acme-challenge {
root /usr/share/nginx/html;
default_type text/plain;
allow all;
}

location / {
rewrite ^ https://$host$request_uri? permanent;
}

#for certbot challenges (renewal process)
location ~ /.well-known/acme-challenge {
allow all;
root /data/letsencrypt;
}
}

#https://ohhaithere.com
Expand Down Expand Up @@ -42,12 +42,6 @@ server {
ssl_stapling_verify on;
resolver 8.8.8.8;

location ^~ /.well-known/acme-challenge {
root /usr/share/nginx/html;
default_type text/plain;
allow all;
}

return 301 https://www.ohhaithere.com$request_uri;
}

Expand All @@ -59,8 +53,6 @@ server {

server_tokens off;

ssl on;

ssl_buffer_size 8k;
ssl_dhparam /etc/ssl/certs/dhparam-2048.pem;

Expand All @@ -79,12 +71,6 @@ server {
ssl_certificate /etc/letsencrypt/live/ohhaithere.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ohhaithere.com/privkey.pem;

location ^~ /.well-known/acme-challenge {
root /usr/share/nginx/html;
default_type text/plain;
allow all;
}

location / {
#security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
Expand Down

0 comments on commit 2f8e7b8

Please sign in to comment.