- MIN_TRAJ_POINTS 100→20 (16척→684척, 파이프라인 병목 해소) - risk.py: SOG 급변 count를 위험도 점수에 반영 (+5/+10) - spoofing.py: BD09 오프셋 중국 MMSI(412*) 예외 (좌표계 노이즈 제거) - fishing_pattern.py: 마지막 조업 세그먼트 누락 버그 수정 - VesselAnalysisService: 인메모리 캐시 + 증분 갱신 (warmup 2h → incremental) - nginx: /api/gtts 프록시 추가 (Google TTS CORS 우회) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
118 lines
3.7 KiB
Plaintext
118 lines
3.7 KiB
Plaintext
server {
|
|
listen 443 ssl;
|
|
server_name kcg.gc-si.dev;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/gitea.gc-si.dev/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/gitea.gc-si.dev/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
# ── Frontend SPA ──
|
|
root /devdata/services/kcg/dist;
|
|
# Static cache
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
index index.html;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# ── Backend API (direct) ──
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:8080/api/;
|
|
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;
|
|
proxy_read_timeout 30s;
|
|
}
|
|
|
|
# ── Backend API (dev prefix 호환) ──
|
|
location /api/kcg/ {
|
|
rewrite ^/api/kcg/(.*) /api/$1 break;
|
|
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;
|
|
proxy_read_timeout 30s;
|
|
}
|
|
|
|
# ── signal-batch 프록시 (선박 위치 API) ──
|
|
location /signal-batch/ {
|
|
proxy_pass https://wing.gc-si.dev/signal-batch/;
|
|
proxy_set_header Host wing.gc-si.dev;
|
|
proxy_ssl_server_name on;
|
|
proxy_read_timeout 30s;
|
|
}
|
|
|
|
# ── 선박 이미지 프록시 (^~ = regex 정적캐시 규칙보다 우선) ──
|
|
location ^~ /shipimg/ {
|
|
proxy_pass https://wing.gc-si.dev/shipimg/;
|
|
proxy_set_header Host wing.gc-si.dev;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
# ── 외부 API 프록시 (프론트엔드 CORS 우회) ──
|
|
location /api/airplaneslive/ {
|
|
proxy_pass https://api.airplanes.live/;
|
|
proxy_set_header Host api.airplanes.live;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
location /api/opensky/ {
|
|
proxy_pass https://opensky-network.org/;
|
|
proxy_set_header Host opensky-network.org;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
location /api/celestrak/ {
|
|
proxy_pass https://celestrak.org/;
|
|
proxy_set_header Host celestrak.org;
|
|
proxy_ssl_server_name on;
|
|
proxy_set_header User-Agent "Mozilla/5.0 (compatible; KCG-Monitor/1.0)";
|
|
}
|
|
|
|
location /api/gdelt/ {
|
|
proxy_pass https://api.gdeltproject.org/;
|
|
proxy_set_header Host api.gdeltproject.org;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
location /api/rss/ {
|
|
proxy_pass https://news.google.com/;
|
|
proxy_set_header Host news.google.com;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
location /api/ais/ {
|
|
proxy_pass https://aisapi.maritime.spglobal.com/;
|
|
proxy_set_header Host aisapi.maritime.spglobal.com;
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
# ── Google TTS 프록시 (중국어 경고문 음성) ──
|
|
location /api/gtts {
|
|
rewrite ^/api/gtts(.*)$ /translate_tts$1 break;
|
|
proxy_pass https://translate.google.com;
|
|
proxy_set_header Host translate.google.com;
|
|
proxy_set_header Referer "https://translate.google.com/";
|
|
proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";
|
|
proxy_ssl_server_name on;
|
|
}
|
|
|
|
# gzip
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
|
|
gzip_min_length 1024;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name kcg.gc-si.dev;
|
|
return 301 https://$host$request_uri;
|
|
}
|