This directive sets the body sent to the backend to the original client request body.
Step 2: Effect on proxy_pass
With this setting, the backend receives the exact data the client sent in the request body.
Final Answer:
The original client request body content -> Option A
Quick Check:
proxy_set_body $request_body forwards client body = A [OK]
Hint: proxy_set_body $request_body forwards client data [OK]
Common Mistakes:
Assuming body is empty by default
Confusing headers with body content
Thinking URI is sent as body
4. You set client_max_body_size 5m; but clients still upload files larger than 5MB without errors. What is the most likely cause?
medium
A. The server has no disk space left
B. The client is ignoring nginx limits
C. The directive is set in the wrong context and not applied
D. The proxy_set_body directive is missing
Solution
Step 1: Check directive context
client_max_body_size must be set in http, server, or location context to apply properly.
Step 2: Understand client behavior and other options
Clients cannot bypass nginx limits; disk space or proxy_set_body do not affect this limit.
Final Answer:
The directive is set in the wrong context and not applied -> Option C
Quick Check:
Wrong context means limit ignored = C [OK]
Hint: Set client_max_body_size in correct context (http/server/location) [OK]
Common Mistakes:
Blaming clients for ignoring limits
Confusing proxy_set_body with size limits
Ignoring directive placement
5. You want nginx to reject client requests with bodies larger than 2MB and forward the exact request body to a backend server. Which configuration snippet achieves this?
hard
A. client_max_body_size 2m;
proxy_set_body $request_body;
proxy_pass http://backend;
B. client_max_body_size 2m;
proxy_pass http://backend;
proxy_set_body $request_body
C. proxy_set_body $request_body;
client_max_body_size 2m;
proxy_pass http://backend
D. proxy_pass http://backend;
client_max_body_size 2m;
proxy_set_body $request_body
Solution
Step 1: Set size limit before proxying
client_max_body_size 2m; must be declared to reject large bodies before proxying.
Step 2: Forward original body to backend
proxy_set_body $request_body; ensures the backend receives the client data exactly.
Step 3: Correct order and syntax
client_max_body_size 2m;
proxy_set_body $request_body;
proxy_pass http://backend; lists directives in proper order and syntax inside the location block.
Final Answer:
client_max_body_size 2m;
proxy_set_body $request_body;
proxy_pass http://backend; -> Option A
Quick Check:
Limit then forward body then proxy = A [OK]
Hint: Set size limit first, then proxy_set_body, then proxy_pass [OK]
Common Mistakes:
Wrong directive order causing ignored limits
Missing semicolons
Not forwarding the request body properly
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.