Skip to content

Commit

Permalink
config: Update Docker Compose file for SSL certificate and Nginx conf…
Browse files Browse the repository at this point in the history
…iguration
  • Loading branch information
drikusroor committed Apr 15, 2024
1 parent 5d3ca9a commit feaabb1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ services:
- "80:80"
volumes:
- ./nginx:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt
- /var/www/certbot:/var/www/certbot
depends_on:
- brazil-blog-web

Expand Down
24 changes: 24 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
server {
listen 80;
server_name brazil.kokokoding.nl;

# Location block for the Let's Encrypt challenge
location ^~ /.well-known/acme-challenge/ {
# Ensure that this location is served from a directory accessible by Certbot
# You may need to set this up in your Docker volume configuration
root /var/www/certbot; # Or another directory that Certbot can write to
try_files $uri =404; # Serve the file if it exists, or return a 404 error
}

# Redirect all other HTTP traffic to HTTPS
location / {
# Uncomment the next line if you're ready to redirect all traffic to HTTPS
return 301 https://$host$request_uri;
}
}

# HTTPS server block (add this once you have obtained the SSL certificate)
server {
listen 443 ssl;
server_name brazil.kokokoding.nl;

ssl_certificate /etc/letsencrypt/live/brazil.kokokoding.nl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/brazil.kokokoding.nl/privkey.pem;

location / {
proxy_pass http://brazil-blog-web:8000;
Expand Down

0 comments on commit feaabb1

Please sign in to comment.