diff --git a/nginx/default.conf b/nginx/default.conf index 1d48d5b..59a63f7 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -183,6 +183,26 @@ server { proxy_pass http://$insta_backend$request_uri; } + # Plan-B-Insta — Windows worker → NAS internal webhook (3-layer 차단) + # Layer 1·2: nginx IP 화이트리스트 (LAN + Tailscale) + # Layer 3: X-Internal-Key (FastAPI dependency) + location /api/internal/insta/ { + 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 $insta_internal_backend insta-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://$insta_internal_backend$request_uri; + } + # portfolio API (Stock) — trailing slash 유무 모두 매칭 location /api/portfolio { proxy_http_version 1.1;