Files
tk-factory-services/system3-nonconformance/web/nginx.conf
Hyungi Ahn 87af06ca9c fix: 일일보고서 권한 체크를 페이지 권한 기반으로 변경 및 Edge 호환성 개선
- reports.py: role==admin 하드코딩 → check_page_access로 변경하여
  reports/reports_daily 페이지 권한 보유자도 미리보기/엑셀 내보내기 가능
- page_permissions.py: 동기 헬퍼 함수 check_page_access() 추가
  (기존 async API 엔드포인트를 await 없이 호출하는 버그 해결)
- reports-daily.html: 에러 핸들링 강화 (401/403 구분), blob download
  revokeObjectURL 지연 처리 (Edge 호환)
- nginx.conf: proxy_read_timeout/proxy_buffering off 추가
- reports.py: JSONResponse+jsonable_encoder로 명시적 직렬화,
  Content-Disposition에 ASCII 폴백 파일명 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 13:50:35 +09:00

62 lines
1.7 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;
}
# 업로드 파일
location /uploads/ {
alias /usr/share/nginx/html/uploads/;
expires 1y;
add_header Cache-Control "public, immutable";
}
location / {
try_files $uri $uri/ /issues-dashboard.html;
}
}