Skip to content

Commit

Permalink
Add cerbot www to nginx/frontend docker to allow cert renewal while s…
Browse files Browse the repository at this point in the history
…ervices are running
  • Loading branch information
lkeegan committed Jan 13, 2025
1 parent c8f1f8f commit 94ed586
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ services:
volumes:
- ${PREDICTCR_SSL_CERT:-./cert.pem}:/predictcr_ssl_cert.pem
- ${PREDICTCR_SSL_KEY:-./key.pem}:/predictcr_ssl_key.pem
- ${PREDICTCR_CERTBOT_WWW:-/var/www/certbot}:/var/www/certbot:ro
networks:
- predictcr-network
email:
Expand Down
18 changes: 17 additions & 1 deletion frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
server {
listen 80;
listen [::]:80;

server_name predictcr.com;
server_tokens off;

location /.well-known/acme-challenge/ {
root /var/www/certbot;
}

location / {
return 301 https://predictcr.com$request_uri;
}
}

server {
server_name www.predictcr.com;
return 301 $scheme://predictcr.com$request_uri;
Expand All @@ -7,7 +23,7 @@ server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name predictcr.com localhost;
server_name predictcr.com;
ssl_certificate /predictcr_ssl_cert.pem;
ssl_certificate_key /predictcr_ssl_key.pem;

Expand Down

0 comments on commit 94ed586

Please sign in to comment.