29 lines
859 B
Plaintext
29 lines
859 B
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;
|
||
|
|
}
|
||
|
|
|
||
|
|
# 해시 자산 장기 캐시
|
||
|
|
location /assets/ {
|
||
|
|
expires 1y;
|
||
|
|
add_header Cache-Control "public, immutable";
|
||
|
|
}
|
||
|
|
|
||
|
|
# 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;
|
||
|
|
}
|
||
|
|
}
|