# Must be at server scope, not on an inner location: client_max_body_size # does not inherit into a nested location that declares its own proxy_pass, # and the http-level 1m default would silently apply and reject firmware # uploads with 413. client_max_body_size 256m; location / { include /etc/nginx/webui-proxy.conf; } # Keep proxy_request_buffering on (the default). Streaming the body races # the Go handler's response close, producing RST instead of FIN at # Content-Length and a client-visible 502. nginx spools the body to # /var/cache/nginx/client-body during the upload instead. location = /firmware/upload { proxy_read_timeout 600s; include /etc/nginx/webui-proxy.conf; } # Liveness probe — nginx-only, no upstream call. Used by the watchdog # div in base.html and the reboot-overlay poller. location = /device-status { access_log off; return 204; }