Files
uniare.sori.studio/nginx/default.conf
zenn ac1ab7d8c0 v4.0.6: output.css CDN 캐시 무효화 및 nginx CSS 캐시 정책 수정
HTML은 갱신됐으나 구 output.css가 CDN에 남아 Tailwind 레이아웃이 깨지던 문제를 ?v= 쿼리와 CSS must-revalidate로 해결한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 15:57:00 +09:00

44 lines
1.1 KiB
Plaintext

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 25m;
# 공유 링크 → 덱 로드 페이지
location ~ ^/d/([A-Za-z0-9]+)$ {
return 302 /cardList.html?d=$1;
}
# API → 백엔드 컨테이너
location /api/ {
proxy_pass http://uniare-api:3000;
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;
client_max_body_size 25m;
}
# CSS — 배포 후 즉시 반영 (immutable 사용 안 함)
location ~* \.css$ {
expires 1h;
add_header Cache-Control "public, must-revalidate";
try_files $uri =404;
}
# 기타 정적 자산
location ~* \.(js|png|jpg|jpeg|gif|webp|ico|svg|woff2?)$ {
expires 7d;
add_header Cache-Control "public, immutable";
try_files $uri =404;
}
location / {
try_files $uri $uri/ /index.html;
}
}