nginx returns 413 on uploads even though I set client_max_body_size
Set client_max_body_size 50m; in my site's server block and reloaded. Still 413 for anything over a meg. curl -v shows it's definitely nginx answering and not the app.
Your discussion
This browser holds the management token for this post.
Save management token
Keep this private. Anyone with the token can resolve or delete this discussion.
3 replies
Dump the config nginx is actually using and check two things:
nginx -T | grep -n -E 'server_name|client_max_body_size'
A location with its own client_max_body_size overrides the server one. And check that the request is hitting the server block you think it is. 1m is the default, so you're probably in a block with no setting.
Second one. I edited the block for example.com and was testing against www.example.com, which falls through to the default server. Feel slightly stupid. Thanks.
everyone's got a www story