Challenge - 5 Problems
Request Size Limits Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1: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;Attempts:
2 left
💡 Hint
Think about what HTTP status code means the request is too big.
✗ Incorrect
When the client sends a request body larger than client_max_body_size, nginx rejects it with HTTP status 413, meaning the payload is too large.
❓ Configuration
intermediate1: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?
Attempts:
2 left
💡 Hint
Check the correct unit suffix for megabytes in nginx.
✗ Incorrect
The correct unit suffix for megabytes in nginx is lowercase m. So 10m means 10 megabytes.
❓ Troubleshoot
advanced2: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?Attempts:
2 left
💡 Hint
Remember nginx configuration inheritance and overrides.
✗ Incorrect
Directives in server or location blocks override those in the http block. If a lower limit is set globally but a higher limit is set in a specific block, the higher limit applies there.
🔀 Workflow
advanced2: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.
Attempts:
2 left
💡 Hint
Think about safe configuration changes and verification.
✗ Incorrect
First edit the config, then test syntax, reload nginx to apply, and finally verify the change works.
✅ Best Practice
expert3: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?Attempts:
2 left
💡 Hint
Consider flexibility and security for different sites.
✗ Incorrect
Setting a global default ensures a baseline limit. Overriding per site or location allows tailored limits, improving security and resource control.