feat(nginx): 3-layer block for /api/internal/insta/ (SP-4)
Layer 1·2: IP 화이트리스트 (192.168.45.0/24 LAN + 100.64.0.0/10 Tailscale). Layer 3: X-Internal-Key 헤더 (FastAPI dependency, 별도 검증). 외부에서 직접 호출 시 403 (nginx deny), LAN에서 키 없으면 401 (FastAPI). Windows insta-render만 호출 가능. Plan-B-Insta Phase 4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user