Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

map $http_upgrade $connection_upgrade {
default upgrade;
'' keep-alive;
}
Comment on lines +14 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

이 설정 파일(nginx/nginx.prod.conf)을 수정하고 계신 것으로 보입니다. 하지만 함께 제공된 docker/server/compose.prod.yaml 파일을 확인해보니, 실제 운영 환경의 nginx 컨테이너는 ../../apps/kokomen-server/nginx/prod/nginx.conf 파일을 마운트하여 사용하고 있습니다. 현재 수정 중인 파일이 실제 운영 환경에 적용되지 않을 수 있으니, 올바른 파일을 수정하고 있는지 반드시 확인해 보시기 바랍니다. 이는 긴급 수정(hotfix)의 의도와 다르게 변경 사항이 전혀 적용되지 않을 수 있는 심각한 문제입니다.


upstream next_server {
server kokomen-client:3000;
keepalive 32;
Expand All @@ -24,13 +29,13 @@ http {
sendfile on;
keepalive_timeout 65;

# HTTP는 두 도메인을 모두 HTTPS로 리다이렉트
# HTTP는 HTTPS로 리다이렉트
server {
listen 80;
listen [::]:80;
server_name kokomen.kr;

# Certbot HTTP-01 챌린지 처리용 (인증서 발급/갱신 시 필요)
# Certbot HTTP-01 챌린지 처리
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
Expand All @@ -44,11 +49,14 @@ http {
}

# -------------------------------
# dev.kokomen.kr (프론트엔드)
# kokomen.kr (프론트엔드)
# -------------------------------
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# http2 지시어는 listen과 분리 (deprecated 경고 해결)
listen 443 ssl;
listen [::]:443 ssl;
http2 on;

server_name kokomen.kr;

# Let’s Encrypt 인증서 경로
Expand All @@ -60,7 +68,7 @@ http {
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;

# 보안 헤더 (필요 시 조정)
# 보안 헤더
add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options SAMEORIGIN always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
Expand All @@ -71,15 +79,15 @@ http {

# WebSocket 지원
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Connection $connection_upgrade; # map으로 정의된 변수 사용

# 원본 헤더 보존
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# 타임아웃/버퍼 (Next.js 빌드/SSR 상황에 따라 조정)
# 타임아웃/버퍼 (Next.js SSR 상황에 따라 조정)
proxy_read_timeout 60s;
proxy_send_timeout 60s;
}
Expand All @@ -88,4 +96,4 @@ http {
access_log /var/log/nginx/dev_kokomen_access.log main;
error_log /var/log/nginx/dev_kokomen_error.log warn;
}
}
}