Files
Vision/config/nginx-aimbot.conf

44 lines
1.2 KiB
Plaintext

# Nginx configuration for Aimbot vision pipeline
# Deploy to: /etc/nginx/sites-available/aimbot
# Enable: ln -s /etc/nginx/sites-available/aimbot /etc/nginx/sites-enabled/
server {
listen 80;
server_name _;
# 前端静态文件 (Vue3 构建产物)
root /var/www/aimbot;
index index.html;
# SPA 路由回退 — 所有非文件请求回 index.html
location / {
try_files $uri $uri/ /index.html;
}
# MJPEG 视频流反代 (web_video_server)
location /stream {
proxy_pass http://127.0.0.1:8081/stream;
proxy_http_version 1.1;
proxy_buffering off;
# MJPEG multipart 边界必须保持完整
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# 长连接支持
proxy_set_header Connection "";
chunked_transfer_encoding off;
# 超时配置 — 视频流需要长连接
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
}
# API (HTTP → ROS2 web_node)
location /api/ {
proxy_pass http://127.0.0.1:8080/api/;
proxy_set_header Host $host;
proxy_set_header Content-Type application/json;
}
}