0
0
Nginxdevops~10 mins

Directory listing (autoindex) 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 directory listing in an Nginx server block.

Nginx
location /files/ {
    [1] on;
}
Drag options to blanks, or click blank then click option'
Alisten
Bindex
Croot
Dautoindex
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'index' instead of 'autoindex' disables directory listing.
Using 'root' or 'listen' does not control directory listing.
2fill in blank
medium

Complete the code to set the directory listing style to 'exact_size' in Nginx.

Nginx
location /downloads/ {
    autoindex on;
    autoindex_format [1];
}
Drag options to blanks, or click blank then click option'
Aexact_size
Bplain
Chtml
Djson
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'html' shows sizes in human-readable format, not exact bytes.
Using unsupported formats like 'json' or 'plain' causes errors.
3fill in blank
hard

Fix the error in the Nginx config to enable directory listing inside the location block.

Nginx
location /media/ {
    autoindex [1];
}
Drag options to blanks, or click blank then click option'
Aenable
Btrue
Con
Dyes
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' instead of 'on' causes syntax errors.
Using 'true' or 'yes' is invalid in Nginx configs.
4fill in blank
hard

Fill both blanks to configure Nginx to serve directory listing with exact file sizes.

Nginx
location /public/ {
    autoindex [1];
    autoindex_format [2];
}
Drag options to blanks, or click blank then click option'
Aon
Boff
Cexact_size
Dhidden
Attempts:
3 left
💡 Hint
Common Mistakes
Setting autoindex to 'off' disables directory listing.
Using wrong format values causes errors.
5fill in blank
hard

Fill both blanks to create a location block that enables directory listing and sets format to HTML.

Nginx
location /assets/ {
    autoindex [1];
    autoindex_format [2];
}
Drag options to blanks, or click blank then click option'
Aoff
Bon
Chtml
Dhidden
Attempts:
3 left
💡 Hint
Common Mistakes
Turning autoindex off disables listing.
Using 'exact_size' instead of 'html' changes the size display style.