0
0
Nginxdevops~10 mins

Gzip compression 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 enable gzip compression in nginx.

Nginx
gzip [1];
Drag options to blanks, or click blank then click option'
Aoff
Bon
Cenable
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' instead of 'on' causes syntax errors.
Using 'true' is not valid in nginx configuration.
2fill in blank
medium

Complete the code to set the minimum file size for gzip compression to 1000 bytes.

Nginx
gzip_min_length [1];
Drag options to blanks, or click blank then click option'
A1000
B500
C1500
D2000
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a value too low or too high changes compression behavior.
Using non-numeric values causes errors.
3fill in blank
hard

Fix the error in the gzip_types directive to compress text and JSON files.

Nginx
gzip_types [1];
Drag options to blanks, or click blank then click option'
Atext/plain application/json
Btext/plain, application/json
Ctext/plain; application/json
Dtext/plain|application/json
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or semicolons causes nginx to fail parsing.
Using pipes is not valid syntax.
4fill in blank
hard

Fill both blanks to set gzip compression level to maximum and disable it for MSIE browsers.

Nginx
gzip_comp_level [1];
gzip_disable "[2]";
Drag options to blanks, or click blank then click option'
A9
B7
CMSIE
DFirefox
Attempts:
3 left
💡 Hint
Common Mistakes
Using compression levels outside 1-9 causes errors.
Disabling gzip for wrong browsers has no effect.
5fill in blank
hard

Fill all three blanks to enable gzip, set minimum length to 500, and compress HTML files.

Nginx
gzip [1];
gzip_min_length [2];
gzip_types [3];
Drag options to blanks, or click blank then click option'
Aon
B500
Ctext/html
Doff
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to enable gzip disables compression.
Using wrong MIME types prevents compression of desired files.