Adds a local file upload path alongside the existing URL download flow: a new /images/upload endpoint streams the file to a temp path and hands it to a background worker that proxies it into Proxmox storage via the upload API (requests-toolbelt handles the large multipart stream). Also adds /images/resolve-filename to recover the real filename (Content- Disposition) for URL-based downloads with opaque paths. Raise nginx client_max_body_size and timeouts on both the frontend proxy and the standalone nginx configs so multi-GB ISOs don't get cut off.
128 lines
4.0 KiB
Nginx Configuration File
128 lines
4.0 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# SPA fallback
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# API proxy
|
|
location /api/ {
|
|
proxy_pass http://app:8000/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 60s;
|
|
}
|
|
|
|
# Proxmox API proxy
|
|
location /proxmox/ {
|
|
proxy_pass http://app:8000/proxmox/;
|
|
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 60s;
|
|
# Загрузка ISO/образов: файлы многогигабайтные, дефолтный
|
|
# client_max_body_size 1m этого server{} блока и короткие таймауты
|
|
# им не подходят.
|
|
client_max_body_size 20g;
|
|
proxy_send_timeout 300s;
|
|
client_body_timeout 3600s;
|
|
}
|
|
|
|
# Settings API proxy
|
|
location /settings/api/ {
|
|
proxy_pass http://app:8000/settings/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 60s;
|
|
}
|
|
|
|
# Templates API proxy
|
|
location /templates/api/ {
|
|
proxy_pass http://app:8000/templates/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 60s;
|
|
}
|
|
|
|
# IPAM API proxy
|
|
location /ipam/api/ {
|
|
proxy_pass http://app:8000/ipam/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 60s;
|
|
}
|
|
|
|
# Logs API proxy
|
|
location /logs/api/ {
|
|
proxy_pass http://app:8000/logs/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 60s;
|
|
}
|
|
|
|
# Admin API proxy
|
|
location /admin/api/ {
|
|
proxy_pass http://app:8000/admin/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 60s;
|
|
}
|
|
|
|
# Health check proxy
|
|
location /health {
|
|
proxy_pass http://app:8000/health;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
# WebSocket proxy
|
|
location /ws/ {
|
|
proxy_pass http://app:8000/ws/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_read_timeout 86400s;
|
|
}
|
|
|
|
# Proxmox WebSocket proxy
|
|
location /proxmox/ws/ {
|
|
proxy_pass http://app:8000/proxmox/ws/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_read_timeout 86400s;
|
|
}
|
|
|
|
# Cache static assets
|
|
location /assets/ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Gzip
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript image/svg+xml;
|
|
gzip_min_length 1000;
|
|
}
|