client_max_body_size 4M; meaning in nginx

Joined
Apr 16, 2023
Messages
149
Reaction score
16
Credits
1,460
Why'd any client send request payload greater than 4MB? I don't understand. What kind of websites need 4MB request payload size?
 


AFAIK it's so that people can upload files larger than 4 MB, though the default is usually 1.

It's useful if you want people to upload 'large' files. On one server I have that set (in PHP actually) to 32 MB because I upload fairly large music files, though they're usually not that large.

It should be set at the lowest value you expect to not cause users issues. You can also indicate that there's a maximum upload size somewhere, assuming this is public-facing (or even user-facing).
 


Latest posts

Top