2026-05-22 21:20:56 +00:00
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name _;
|
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
|
index index.html;
|
|
|
|
|
|
|
|
|
|
location /api/ {
|
2026-05-22 22:06:21 +00:00
|
|
|
proxy_pass http://zeavis-api:3000/api/;
|
|
|
|
|
proxy_set_header Host $host;
|
2026-05-22 21:20:56 +00:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-07 20:57:45 +07:00
|
|
|
# Expose API metrics through the web endpoint (Prometheus scrape target)
|
|
|
|
|
location /metrics {
|
|
|
|
|
proxy_pass http://zeavis-api:3000/metrics;
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-07 23:44:57 +07:00
|
|
|
# ── Telemetry Dashboard Proxy (orange VPS via Tailscale) ──────────────
|
|
|
|
|
# Telemetry UI SPA assets (fingerprinted by Vite, cache aggressively)
|
|
|
|
|
location /telemetry/assets/ {
|
|
|
|
|
proxy_pass http://100.96.248.86:8181/assets/;
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
expires 1y;
|
|
|
|
|
add_header Cache-Control "public, immutable";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Telemetry API calls (query proxy + target management)
|
|
|
|
|
location /telemetry/proxy/ {
|
|
|
|
|
proxy_pass http://100.96.248.86:8181/proxy/;
|
|
|
|
|
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;
|
|
|
|
|
proxy_connect_timeout 5s;
|
|
|
|
|
proxy_send_timeout 35s;
|
|
|
|
|
proxy_read_timeout 35s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location /telemetry/api/ {
|
|
|
|
|
proxy_pass http://100.96.248.86:8181/api/;
|
|
|
|
|
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;
|
|
|
|
|
proxy_connect_timeout 5s;
|
|
|
|
|
proxy_send_timeout 10s;
|
|
|
|
|
proxy_read_timeout 10s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Telemetry SPA — proxy to orange, rewrite root-relative paths to prefix
|
|
|
|
|
location /telemetry/ {
|
|
|
|
|
proxy_pass http://100.96.248.86:8181/;
|
|
|
|
|
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;
|
|
|
|
|
proxy_connect_timeout 5s;
|
|
|
|
|
proxy_send_timeout 35s;
|
|
|
|
|
proxy_read_timeout 35s;
|
|
|
|
|
|
|
|
|
|
# Rewrite root-relative paths in HTML/JS to /telemetry/ prefix
|
|
|
|
|
sub_filter_types text/html application/javascript;
|
|
|
|
|
sub_filter_once off;
|
|
|
|
|
sub_filter 'src="/' 'src="/telemetry/';
|
|
|
|
|
sub_filter 'href="/' 'href="/telemetry/';
|
|
|
|
|
sub_filter "url('/" "url('/telemetry/";
|
|
|
|
|
sub_filter 'fetch("/' 'fetch("/telemetry/');
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-22 21:20:56 +00:00
|
|
|
location / {
|
|
|
|
|
try_files $uri $uri/ /index.html;
|
|
|
|
|
}
|
|
|
|
|
}
|