0
0
Nginxdevops~20 mins

Request size limits (client_max_body_size) in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Request Size Limits Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What happens when a client sends a request larger than the configured limit?
Given the nginx configuration directive client_max_body_size 1m;, what is the HTTP status code returned if a client uploads a file of 2 megabytes?
Nginx
client_max_body_size 1m;
A404 Not Found
B413 Payload Too Large
C500 Internal Server Error
D200 OK
Attempts:
2 left
💡 Hint
Think about what HTTP status code means the request is too big.
Configuration
intermediate
1:30remaining
How to set a 10 megabyte request size limit in nginx?
Which configuration snippet correctly sets the maximum allowed client request body size to 10 megabytes?
Aclient_max_body_size 10m;
Bclient_max_body_size 10mb;
Cclient_max_body_size 10
Dclient_max_body_size 10MB;
Attempts:
2 left
💡 Hint
Check the correct unit suffix for megabytes in nginx.
Troubleshoot
advanced
2:00remaining
Why does nginx still accept large uploads despite setting client_max_body_size?
You set client_max_body_size 1m; in the http block of nginx.conf, but clients can still upload files larger than 1 megabyte. What is the most likely reason?
AThe client is using chunked transfer encoding which bypasses the limit
Bnginx does not enforce client_max_body_size in the http block
CThe directive is overridden by a <code>server</code> or <code>location</code> block with a higher limit
DThe directive requires a reload of the operating system to take effect
Attempts:
2 left
💡 Hint
Remember nginx configuration inheritance and overrides.
🔀 Workflow
advanced
2:30remaining
Order the steps to apply a new client_max_body_size setting in nginx
Put these steps in the correct order to change the client_max_body_size to 5 megabytes and apply it safely.
A1,2,4,3
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Think about safe configuration changes and verification.
Best Practice
expert
3:00remaining
What is the best practice for setting client_max_body_size in a multi-site nginx server?
You manage an nginx server hosting multiple websites with different upload size needs. What is the best practice for setting client_max_body_size?
ASet a global default in the http block and override per server or location as needed
BSet the largest needed size globally in the http block to cover all sites
CSet client_max_body_size only in the main nginx.conf file without overrides
DDo not set client_max_body_size and rely on application-level limits
Attempts:
2 left
💡 Hint
Consider flexibility and security for different sites.