Files
tk-factory-services/user-management/web/nginx.conf
Hyungi Ahn 64e3c1227d refactor: 미사용 의존성 제거 + deprecated API 수정 + 정리
- SSO/System2: 미사용 redis, bcrypt, multer 의존성 제거
- System2: dbPool.js shim 삭제, workIssueModel을 config/database 직접 참조로 변경
- System3: deprecated datetime.utcnow() → datetime.now(timezone.utc)
- System3: deprecated @app.on_event("startup") → lifespan 패턴
- System3: 중복 /users 라우트 제거, 불필요 파일 삭제
- health-check.sh: tkuser API/Web 체크 추가
- tkuser nginx: upstream 이름 수정 (tk-system2-api → system2-api)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 08:35:11 +09:00

74 lines
2.1 KiB
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.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";
}
# 정적 파일
location / {
try_files $uri $uri/ /index.html;
}
# 업로드 파일 프록시 (^~ 로 regex location보다 우선 매칭)
location ^~ /uploads/ {
proxy_pass http://tkuser-api:3000/uploads/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# work-issues API 프록시 → system2-api
location /api/work-issues/ {
proxy_pass http://system2-api:3005;
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;
}
# API 프록시 → tkuser-api
location /api/ {
proxy_pass http://tkuser-api: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_cache_bypass $http_upgrade;
}
# Health check
location /health {
access_log off;
return 200 'ok';
add_header Content-Type text/plain;
}
}