사주 풀이 고도화, NAS 배포 자동화
This commit is contained in:
84
nginx-config.conf
Normal file
84
nginx-config.conf
Normal file
@@ -0,0 +1,84 @@
|
||||
# ============================================
|
||||
# Nginx 설정 - /saju 라우팅
|
||||
# ============================================
|
||||
# 이 설정을 기존 nginx/default.conf의 server { } 블록 안에 추가하세요.
|
||||
# ============================================
|
||||
|
||||
# /saju 경로 → saju-web 컨테이너로 프록시
|
||||
location /saju {
|
||||
# saju-web 컨테이너로 전달
|
||||
proxy_pass http://saju-web:3000;
|
||||
|
||||
# 필수 헤더 설정
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
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;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
|
||||
# 캐시 무효화
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
|
||||
# 타임아웃 설정 (AI 해석 등 긴 요청 대비)
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_read_timeout 60s;
|
||||
|
||||
# 버퍼 설정
|
||||
proxy_buffering on;
|
||||
proxy_buffer_size 4k;
|
||||
proxy_buffers 8 4k;
|
||||
proxy_busy_buffers_size 8k;
|
||||
}
|
||||
|
||||
# Next.js static files (_next/static)
|
||||
location ~ ^/saju/_next/static/(.*)$ {
|
||||
proxy_pass http://saju-web:3000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
# Static files는 장기 캐싱
|
||||
proxy_cache_valid 200 365d;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
|
||||
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 images, fonts 등
|
||||
location ~ ^/saju/_next/(.*)$ {
|
||||
proxy_pass http://saju-web:3000;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
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;
|
||||
|
||||
# 적절한 캐싱
|
||||
add_header Cache-Control "public, max-age=3600";
|
||||
}
|
||||
|
||||
# ============================================
|
||||
# 참고: 전체 nginx/default.conf 구조 예시
|
||||
# ============================================
|
||||
# server {
|
||||
# listen 80;
|
||||
# server_name gahusb.synology.me;
|
||||
#
|
||||
# # 기존 설정들...
|
||||
# location / { ... }
|
||||
# location /api/lotto { ... }
|
||||
# location /api/travel { ... }
|
||||
# location /api/stock { ... }
|
||||
#
|
||||
# # 👇 여기에 위 설정 추가
|
||||
# location /saju { ... }
|
||||
# location ~ ^/saju/_next/static/(.*)$ { ... }
|
||||
# location ~ ^/saju/_next/(.*)$ { ... }
|
||||
# }
|
||||
Reference in New Issue
Block a user