0
0
Nginxdevops~20 mins

Brotli compression in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Brotli Compression Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Check if Brotli module is enabled in nginx
You run the command nginx -V 2>&1 | grep brotli on your server. What output indicates that the Brotli module is enabled?
Nginx
nginx -V 2>&1 | grep brotli
A
nginx version: nginx/1.21.0
built with OpenSSL 1.1.1
--with-http_gzip_module
B
nginx version: nginx/1.21.0
built with OpenSSL 1.1.1
--without-http_brotli_module
C
nginx version: nginx/1.21.0
built with OpenSSL 1.1.1
--with-http_brotli_module
Dcommand not found
Attempts:
2 left
💡 Hint
Look for the phrase '--with-http_brotli_module' in the output.
Configuration
intermediate
1:30remaining
Enable Brotli compression in nginx config
Which nginx configuration snippet correctly enables Brotli compression for text and JSON files?
A
brotli enable yes;
brotli_types text/plain application/json;
B
brotli on off;
brotli_types application/xml;
C
brotli on;
brotli_types text/html image/png;
D
brotli on;
brotli_types text/plain application/json;
Attempts:
2 left
💡 Hint
The directive to enable Brotli is 'brotli on;' and you specify file types with 'brotli_types'.
Troubleshoot
advanced
2:00remaining
Why is Brotli compression not working for CSS files?
You enabled Brotli compression in nginx but CSS files are not compressed. Which is the most likely cause?
AThe 'brotli_types' directive does not include 'text/css'.
BBrotli compression only works for images, not CSS.
CThe 'brotli on;' directive is missing from the server block.
DCSS files are too small to be compressed by Brotli.
Attempts:
2 left
💡 Hint
Check which MIME types are listed in 'brotli_types'.
🔀 Workflow
advanced
2:30remaining
Order the steps to enable Brotli compression in nginx
Put these steps in the correct order to enable Brotli compression on an nginx server.
A3,1,2,4
B1,2,3,4
C1,3,2,4
D2,1,3,4
Attempts:
2 left
💡 Hint
You must install the module before configuring it, then test and reload.
Best Practice
expert
2:00remaining
Best practice for Brotli compression level in nginx
Which Brotli compression level setting balances good compression and server performance in nginx?
Abrotli_comp_level 5;
Bbrotli_comp_level 1;
Cbrotli_comp_level 0;
Dbrotli_comp_level 11;
Attempts:
2 left
💡 Hint
Higher levels compress better but use more CPU time.