Configure production HTTPS with SSL certificates

This commit is contained in:
gamvo74 2026-02-25 09:02:22 -05:00
parent db7bfd52b0
commit 8d65a840c6
3 changed files with 23 additions and 4 deletions

View File

@ -49,9 +49,10 @@ services:
restart: always restart: always
ports: ports:
- "80:80" - "80:80"
- "8080:8080" - "443:443"
volumes: volumes:
- ./infrastructure/nginx/conf.d:/etc/nginx/conf.d - ./infrastructure/nginx/conf.d:/etc/nginx/conf.d
- /etc/letsencrypt:/etc/letsencrypt:ro
depends_on: depends_on:
- api - api
- web - web

View File

@ -1,6 +1,15 @@
server { server {
listen 80; listen 80;
server_name api.proselitigant.tech localhost; server_name api.proselitigant.tech;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name api.proselitigant.tech;
ssl_certificate /etc/letsencrypt/live/proselitigant.tech/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/proselitigant.tech/privkey.pem;
# Security headers # Security headers
add_header X-Frame-Options DENY; add_header X-Frame-Options DENY;

View File

@ -1,6 +1,15 @@
server { server {
listen 8080; listen 80;
server_name proselitigant.tech localhost; server_name proselitigant.tech;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name proselitigant.tech;
ssl_certificate /etc/letsencrypt/live/proselitigant.tech/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/proselitigant.tech/privkey.pem;
# Security headers # Security headers
add_header X-Frame-Options SAMEORIGIN; add_header X-Frame-Options SAMEORIGIN;