You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a POST request with a large body is sent to an endpoint that has client_max_body_size set appropriately at the "location" level, the request returns 500. Normally, a request that fails the client_max_body_size check returns a 413 error, so the 500 error implies that a check is failing after the initial request. The nginx log shows messages like: 2024/08/22 02:18:47 [error] 6252#6252: *704866 client intended to send too large body: 1143545 bytes, client: 192.168.46.29, server: devcluster.finocomp.local, request: "POST /upload HTTP/1.1", subrequest: "/_jwks_uri", host: "devcluster.finocomp.local", referrer: "http://devcluster.finocomp.local/upload"
The mention of subrequest: "/_jwks_uri" led me to look at its configuration in openid_connect.server_conf. My suspicion is that the body size is being checked before the subrequest is performed, even though proxy_method GET and proxy_set_header Content-Length "" are being applied.
I modified the configuration to add a client_max_body_size directive:
I think it should be safe to disable the client_max_body_size check here because the subrequest is proxied as a GET regardless of the original request type and should never have a body.
The text was updated successfully, but these errors were encountered:
When a POST request with a large body is sent to an endpoint that has client_max_body_size set appropriately at the "location" level, the request returns 500. Normally, a request that fails the client_max_body_size check returns a 413 error, so the 500 error implies that a check is failing after the initial request. The nginx log shows messages like:
2024/08/22 02:18:47 [error] 6252#6252: *704866 client intended to send too large body: 1143545 bytes, client: 192.168.46.29, server: devcluster.finocomp.local, request: "POST /upload HTTP/1.1", subrequest: "/_jwks_uri", host: "devcluster.finocomp.local", referrer: "http://devcluster.finocomp.local/upload"
The mention of
subrequest: "/_jwks_uri"
led me to look at its configuration in openid_connect.server_conf. My suspicion is that the body size is being checked before the subrequest is performed, even thoughproxy_method GET
andproxy_set_header Content-Length ""
are being applied.I modified the configuration to add a client_max_body_size directive:
Large file uploads now work as expected.
I think it should be safe to disable the client_max_body_size check here because the subrequest is proxied as a GET regardless of the original request type and should never have a body.
The text was updated successfully, but these errors were encountered: