Skip to content

Commit 54827ca

Browse files
committed
fix: ssl 관련 설정 강화
1 parent 3a7e265 commit 54827ca

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

services/nginx/conf.d/prod_nginx.conf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ server {
22
listen 80;
33
server_name octodocs.com www.octodocs.com;
44

5-
# Certbot 인증용 경로
6-
location /.well-known/acme-challenge/ {
5+
# Certbot 인증용 경로 (최상단에 위치)
6+
location ^~ /.well-known/acme-challenge/ {
77
root /var/www/certbot;
8+
try_files $uri =404;
9+
break;
810
}
911

1012
# 나머지 모든 HTTP 트래픽은 HTTPS로 리다이렉트
@@ -26,6 +28,14 @@ server {
2628
ssl_ciphers HIGH:!aNULL:!MD5;
2729
ssl_prefer_server_ciphers on;
2830

31+
# 인증서가 없을 때 fallback
32+
ssl_trusted_certificate /etc/letsencrypt/live/octodocs.com/chain.pem;
33+
ssl_stapling on;
34+
ssl_stapling_verify on;
35+
36+
# 에러 페이지 설정
37+
error_page 497 https://$server_name$request_uri;
38+
2939
# gzip 압축 설정
3040
gzip on;
3141
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
@@ -49,7 +59,7 @@ server {
4959

5060
# Socket.IO 프록시 (일반 웹소켓)
5161
location /socket.io {
52-
proxy_pass http://backend:3000;
62+
proxy_pass http://backend:1234;
5363
proxy_http_version 1.1;
5464
proxy_set_header Upgrade $http_upgrade;
5565
proxy_set_header Connection "Upgrade";

0 commit comments

Comments
 (0)