0
0
Nginxdevops~10 mins

Request body handling in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the maximum allowed size of the client request body to 1 megabyte.

Nginx
client_max_body_size [1];
Drag options to blanks, or click blank then click option'
A1m
B512k
C2m
D10m
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1mb' instead of '1m' which is invalid in nginx.
Setting the size too low or too high unintentionally.
2fill in blank
medium

Complete the code to enable buffering of client request bodies in a temporary file.

Nginx
client_body_buffer_size [1];
Drag options to blanks, or click blank then click option'
A4k
B8k
C32k
D16k
Attempts:
3 left
💡 Hint
Common Mistakes
Setting the buffer size too small causing frequent disk writes.
Using invalid size units.
3fill in blank
hard

Fix the error in the code to correctly specify the temporary directory for client body files.

Nginx
client_body_temp_path [1];
Drag options to blanks, or click blank then click option'
A/tmp/nginx/client_body
B/var/nginx/tmp/client_body
C/var/tmp/nginx/client_body
D/usr/tmp/client_body
Attempts:
3 left
💡 Hint
Common Mistakes
Using a directory that nginx cannot write to.
Specifying a non-existent or incorrect path.
4fill in blank
hard

Fill both blanks to configure nginx to read client request bodies in 8k chunks and store temporary files in /var/tmp/nginx/client_body.

Nginx
client_body_buffer_size [1];
client_body_temp_path [2];
Drag options to blanks, or click blank then click option'
A8k
B/var/tmp/nginx/client_body
C/tmp/nginx/client_body
D16k
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up buffer size and temp path values.
Using invalid directory paths.
5fill in blank
hard

Fill all three blanks to create a configuration that limits client request body size to 2 megabytes, buffers 16k chunks, and stores temporary files in /tmp/nginx/client_body.

Nginx
client_max_body_size [1];
client_body_buffer_size [2];
client_body_temp_path [3];
Drag options to blanks, or click blank then click option'
A1m
B16k
C/tmp/nginx/client_body
D2m
Attempts:
3 left
💡 Hint
Common Mistakes
Using '1m' instead of '2m' for max body size.
Confusing buffer size with max body size.
Specifying a non-existent temporary directory.