Files
kvm-manager/frontend/nginx.conf
T
2026-04-30 15:51:48 +08:00

35 lines
797 B
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# SPA 路由支持
location / {
try_files $uri $uri/ /index.html;
}
# API 代理
location /api/ {
proxy_pass http://backend:8004/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_read_timeout 300s;
}
# 健康检查
location /health {
proxy_pass http://backend:8004/health;
}
# WebSocket (VNC)
location /websockify {
proxy_pass http://backend:8004/websockify;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}