Recall & Review
beginner
What does the
autoindex directive do in nginx?The
autoindex directive enables or disables automatic directory listing when no index file is found in a directory.Click to reveal answer
beginner
How do you enable directory listing for a specific location in nginx?
Inside the
location block, set autoindex on; to enable directory listing for that path.Click to reveal answer
beginner
What is the default state of
autoindex in nginx?By default,
autoindex is off, so directory listing is disabled unless explicitly enabled.Click to reveal answer
beginner
Which nginx configuration block is used to control directory listing?
The
location block controls directory listing by using the autoindex directive inside it.Click to reveal answer
intermediate
What happens if
autoindex is off and no index file exists in a directory?nginx will return a 403 Forbidden or 404 Not Found error instead of showing the directory contents.
Click to reveal answer
Which directive enables directory listing in nginx?
✗ Incorrect
The
autoindex on; directive enables directory listing in nginx.Where do you place the
autoindex directive to enable directory listing?✗ Incorrect
The
autoindex directive is placed inside a location block to enable directory listing for that path.What is the default value of
autoindex in nginx?✗ Incorrect
By default,
autoindex is set to off in nginx.If directory listing is disabled and no index file exists, what does nginx do?
✗ Incorrect
nginx returns a 403 Forbidden or 404 Not Found error if directory listing is off and no index file is found.
How do you disable directory listing if it was previously enabled?
✗ Incorrect
To disable directory listing, set
autoindex off; inside the relevant location block.Explain how to enable directory listing in nginx and what configuration block is used.
Think about where nginx controls URL paths and how to turn on directory listing.
You got /4 concepts.
Describe what happens when directory listing is disabled and a user tries to access a directory without an index file.
Consider nginx's default behavior when it cannot find a file to serve.
You got /4 concepts.