mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 07:24:52 +09:00
Stop reading rejected save uploads to the controller
When a host pushes a save to a stream that is gone, or that timed out before anyone downloaded it, the controller answers 404 or 500 without reading the body. Node then reads and throws away the rest of the body to keep the connection open, so a proxy in front of the controller that keeps passing the upload on made the whole save get uploaded for nothing. Close the connection if the body hasn't ended a second after the response. Document turning off request buffering in reverse proxies, as a buffering proxy holds the upload back until all of it has arrived.
This commit is contained in:
3 files changed
+86
-3
No files matched your search
@@ -19,6 +19,12 @@ Additianlly WebSocket connections to `/api/socket` also needs to be forwarded.
|
||||
Typically this requires explicit configuration and support for forwarding WebSocket connections.
|
||||
If the interface hosted under a sub-path the `/api/socket` address is relative to the sub-path and the sub-path also needs to be stripped out when forwarded.
|
||||
|
||||
Saves are sent from hosts to the web interface through the controller as they are uploaded to `/api/stream/`.
|
||||
If the proxy buffers request bodies it holds back a host's upload until all of it has arrived.
|
||||
A save that takes longer than `controller.proxy_stream_timeout` to upload then fails, after the whole save was sent.
|
||||
Turn request buffering off for the proxy, with Nginx this is `proxy_request_buffering off;`.
|
||||
Nginx also limits request bodies to 1 MB by default, set `client_max_body_size` high enough for the saves and mods you upload.
|
||||
|
||||
You can also optionally set the controller to listen only on the loopback interface to prevent it being directly connected to from the outside.
|
||||
|
||||
npx clusteriocontroller config set controller.bind_address 127.0.0.1
|
||||
|
||||
Reference in new issue
Block a user