Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'index' instead of 'autoindex' disables directory listing.
Using 'root' or 'listen' does not control directory listing.
✗ Incorrect
The autoindex directive enables directory listing in Nginx.
2fill in blank
mediumComplete 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'
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.
✗ Incorrect
The autoindex_format exact_size directive shows file sizes in bytes.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' instead of 'on' causes syntax errors.
Using 'true' or 'yes' is invalid in Nginx configs.
✗ Incorrect
The correct value to enable autoindex is on.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting autoindex to 'off' disables directory listing.
Using wrong format values causes errors.
✗ Incorrect
Enable autoindex with on, set format to exact_size.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Turning autoindex off disables listing.
Using 'exact_size' instead of 'html' changes the size display style.
✗ Incorrect
Enable directory listing with on, set format to html.