Files
sb-front/deploy/nginx-sb-front.conf
T
ByungCheol 786f7aae61
CI / build (push) Failing after 14m5s
feat: 웹 안내 페이지에 PC 버전(Windows) 다운로드 링크 추가
- WebOnlyNotice: PC 버전 다운로드 버튼(/download/SlimBudget-Setup.exe) + 모바일(준비 중)
- nginx: /download/ 위치 추가 — 배포(dist 교체)에 안 지워지는 /var/www/sb-downloads 에서 서빙
- 설치파일 이름 고정(SlimBudget-Setup.exe)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 16:54:28 +09:00

45 lines
1.7 KiB
Plaintext

# /etc/nginx/sites-available/sb-front (심볼릭 링크로 sites-enabled 에 연결)
server {
listen 80;
server_name _; # 도메인으로 교체
root /var/www/sb-front; # DEPLOY_PATH 와 동일
index index.html;
# SPA: 새로고침/직접 진입 시 index.html 로 폴백 (vue-router history 모드)
location / {
try_files $uri $uri/ /index.html;
}
# index.html 은 캐시 금지 — 배포로 청크 해시가 바뀌어도 항상 최신 진입점을 받도록.
# (캐시되면 옛 index.html 이 삭제된 옛 청크를 불러 메뉴가 안 열리는 문제 발생)
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate";
expires -1;
}
# 해시 자산 장기 캐시 (파일명에 해시가 있어 immutable 안전)
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# 설치파일 다운로드 — 배포(dist 교체)에 지워지지 않도록 root 밖의 영속 디렉터리에서 서빙.
# 서버에 /var/www/sb-downloads/ 를 만들고 설치파일(SlimBudget-Setup.exe)을 올려두세요.
# 예) sudo mkdir -p /var/www/sb-downloads && sudo cp SlimBudget-Setup.exe /var/www/sb-downloads/
location /download/ {
alias /var/www/sb-downloads/;
add_header Content-Disposition "attachment";
autoindex off;
}
# API 프록시 → 백엔드(8080)
location /api/ {
proxy_pass http://127.0.0.1:8080;
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;
}
}