Skip to content

Commit 69d6a2e

Browse files
authored
배포 환경 설정 파일 추가 (#176)
1 parent 950f081 commit 69d6a2e

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

docker/deploy/default.conf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
server {
2+
listen 80;
3+
server_name 15.164.219.98.nip.io;
4+
5+
location ^~ /.well-known/acme-challenge/ {
6+
default_type "text/plain";
7+
root /var/www/certbot;
8+
allow all;
9+
}
10+
11+
# HTTP를 HTTPS로 리다이렉트
12+
location / {
13+
return 301 https://$host$request_uri;
14+
}
15+
}
16+
17+
server {
18+
listen 443 ssl;
19+
server_name 15.164.219.98.nip.io;
20+
21+
# SSL 인증서 설정
22+
ssl_certificate /etc/letsencrypt/live/15.164.219.98.nip.io/fullchain.pem;
23+
ssl_certificate_key /etc/letsencrypt/live/15.164.219.98.nip.io/privkey.pem;
24+
25+
# SSL 설정 최적화
26+
ssl_protocols TLSv1.2 TLSv1.3;
27+
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
28+
ssl_prefer_server_ciphers off;
29+
30+
# HSTS 설정 (선택사항)
31+
add_header Strict-Transport-Security "max-age=31536000" always;
32+
33+
location / {
34+
proxy_pass http://172.31.42.108:8080;
35+
proxy_set_header Host $host;
36+
proxy_set_header X-Real-IP $remote_addr;
37+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38+
proxy_set_header X-Forwarded-Proto $scheme;
39+
}
40+
}

docker/deploy/nginx-compose.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
services:
2+
nginx:
3+
image: nginx:latest
4+
ports:
5+
- "80:80"
6+
- "443:443"
7+
volumes:
8+
- ./conf.d:/etc/nginx/conf.d
9+
- ./certbot/conf:/etc/letsencrypt
10+
- ./certbot/www:/var/www/certbot
11+
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
12+
networks:
13+
- app-network
14+
certbot:
15+
image: certbot/certbot
16+
volumes:
17+
- ./certbot/conf:/etc/letsencrypt
18+
- ./certbot/www:/var/www/certbot
19+
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
20+
networks:
21+
- app-network
22+
networks:
23+
app-network:
24+
driver: bridge

0 commit comments

Comments
 (0)