diff --git a/nginx/default.conf b/nginx/default.conf index 0ad1d96..a521381 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -210,6 +210,26 @@ server { proxy_pass http://$insta_internal_backend$request_uri; } + # Plan-B-Music — Windows music-render → NAS music-lab internal webhook + # Layer 1·2: nginx IP 화이트리스트 (LAN + Tailscale) + # Layer 3: X-Internal-Key (FastAPI dependency) + location /api/internal/music/ { + allow 192.168.45.0/24; # LAN 화이트리스트 + allow 100.64.0.0/10; # Tailscale CGNAT + allow 127.0.0.1; # NAS 내부 + deny all; + + resolver 127.0.0.11 valid=10s; + set $music_internal_backend music-lab:8000; + + 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-Internal-Key $http_x_internal_key; + proxy_pass http://$music_internal_backend$request_uri; + } + # portfolio API (Stock) — trailing slash 유무 모두 매칭 location /api/portfolio { proxy_http_version 1.1;