Files
tk-factory-services/system3-nonconformance/web/nginx.conf
Hyungi Ahn 85f674c9cb feat: ai-service를 ds923에서 맥미니로 이전
- ChromaDB → Qdrant 전환 (맥미니 기존 인스턴스, tk_qc_issues 컬렉션)
- Ollama 임베딩/텍스트 생성 URL 분리 (임베딩: 맥미니, 텍스트: GPU서버)
- MLX fallback 제거, Ollama 단일 경로로 단순화
- ds923 docker-compose에서 ai-service 제거
- gateway/system3-web nginx: ai-service 프록시를 ai.hyungi.net 경유로 변경
- resolver + 변수 기반 proxy_pass로 런타임 DNS 해석 (컨테이너 시작 실패 방지)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:36:42 +09:00

88 lines
2.5 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
client_max_body_size 10M;
root /usr/share/nginx/html;
index issues-dashboard.html;
# gzip 압축
gzip on;
gzip_types text/plain text/css application/javascript application/json;
gzip_min_length 1024;
# HTML 캐시 비활성화
location ~* \.html$ {
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
# JS/CSS 캐시 활성화 (버전 쿼리 스트링으로 무효화)
location ~* \.(js|css)$ {
expires 1h;
add_header Cache-Control "public, no-transform";
}
# 정적 파일 (이미지 등)
location ~* \.(png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf)$ {
expires 1h;
add_header Cache-Control "public, no-transform";
}
# API 프록시 (System 3 API)
location /api/ {
proxy_pass http://system3-api:8000/api/;
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_cache_bypass $http_upgrade;
# 엑셀 생성 등 시간이 걸리는 API 대응
proxy_read_timeout 120s;
proxy_send_timeout 120s;
proxy_buffering off;
}
# AI API 프록시 (맥미니 home-service-proxy 경유)
location /ai-api/ {
resolver 8.8.8.8 valid=300s ipv6=off;
set $ai_upstream https://ai.hyungi.net;
rewrite ^/ai-api/(.*) /api/ai/$1 break;
proxy_pass $ai_upstream;
proxy_http_version 1.1;
proxy_set_header Host ai.hyungi.net;
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_ssl_server_name on;
proxy_read_timeout 180s;
proxy_send_timeout 180s;
}
# 모바일 전용 페이지
location /m/ {
alias /usr/share/nginx/html/m/;
try_files $uri $uri/ /m/dashboard.html;
location ~* \.html$ {
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
}
# 업로드 파일
location /uploads/ {
alias /usr/share/nginx/html/uploads/;
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri/ /issues-dashboard.html;
}
}