Skip to content

Commit 0910522

Browse files
committed
Feat : https 인증서 설정
1 parent e413e74 commit 0910522

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

docker-compose.common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ services:
1818
- "443:443"
1919
volumes:
2020
- /home/ubuntu/tinybite/nginx/default.conf:/etc/nginx/conf.d/default.conf
21-
- /home/ubuntu/tinybite/data/certbot/conf:/etc/letsencrypt
21+
- /etc/letsencrypt:/etc/letsencrypt
2222
- /home/ubuntu/tinybite/data/certbot/www:/var/www/certbot
2323
restart: always
2424
network_mode: host

nginx/default.conf

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,22 @@ server {
77
}
88

99
location / {
10-
proxy_pass http://tinybite-api:8080;
10+
return 301 https://$host$request_uri;
11+
}
12+
}
13+
14+
server {
15+
listen 443 ssl;
16+
server_name tinybite.duckdns.org;
17+
18+
ssl_certificate /etc/letsencrypt/live/tinybite.duckdns.org/fullchain.pem;
19+
ssl_certificate_key /etc/letsencrypt/live/tinybite.duckdns.org/privkey.pem;
20+
21+
location / {
22+
proxy_pass http://localhost:8080;
1123
proxy_set_header Host $host;
1224
proxy_set_header X-Real-IP $remote_addr;
25+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26+
proxy_set_header X-Forwarded-Proto $scheme;
1327
}
1428
}

0 commit comments

Comments
 (0)