Files

87 lines
3.1 KiB
Plaintext

upstream ymhut_unified_management {
server 127.0.0.1:33550;
keepalive 16;
}
server {
listen 443 ssl http2;
server_name update.example.com;
# Default package limit (1 GiB) plus multipart form overhead.
# Increase both this value and YMHUT_RELEASE_UPLOAD_MAX_BYTES together.
client_max_body_size 1032m;
location /downloads/ {
# Replace this path with the configured DownloadsDir.
alias /srv/ymhut/data/update/public/downloads/;
sendfile on;
tcp_nopush on;
etag on;
add_header Cache-Control "public, max-age=300" always;
}
location = /api/admin/releases/packages {
proxy_pass http://ymhut_unified_management;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off;
proxy_read_timeout 30m;
proxy_send_timeout 30m;
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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /api/admin/events {
proxy_pass http://ymhut_unified_management;
proxy_http_version 1.1;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 1h;
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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
# Hashed Vite assets are immutable. A missing asset remains a real 404;
# never route it back to the SPA HTML shell.
location ~* ^/admin/assets/.+-[A-Za-z0-9_-]{8,}\.(?:js|css|woff2?|ttf|eot|svg|png|webp)$ {
proxy_pass http://ymhut_unified_management;
proxy_http_version 1.1;
proxy_intercept_errors off;
add_header Cache-Control "public, max-age=31536000, immutable";
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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /admin/ {
proxy_pass http://ymhut_unified_management;
proxy_http_version 1.1;
proxy_intercept_errors off;
add_header Cache-Control "no-store" always;
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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
proxy_pass http://ymhut_unified_management;
proxy_http_version 1.1;
proxy_read_timeout 60s;
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-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
}
}