mirror of
https://github.com/the-spellman/tech-docs-md
synced 2024-10-29 22:47:52 +00:00
Create nginx-filelistmode.md
This commit is contained in:
parent
7ab6f347f1
commit
2296167554
1 changed files with 11 additions and 0 deletions
11
nginx-filelistmode.md
Normal file
11
nginx-filelistmode.md
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Enabling File List Mode NGINX
|
||||
|
||||
If there isn't an `index.html` file in a specific directory you want to view, accessing that URL path will result in a "404 Not Found" error. However, Nginx includes an autoindex module that can automatically generate a directory listing. Adding autoindex to your Nginx configuration is straightforward. Simply add it to the `location` block in your Nginx configuration file like this:
|
||||
|
||||
```nginx
|
||||
location /somedirectory/ {
|
||||
autoindex on;
|
||||
}
|
||||
```
|
||||
|
||||
Once you've made this change, restart your Nginx server using `sudo service nginx restart`. Now, instead of displaying a "404" error, the web server will show a directory listing similar to the one described earlier for the directory/directories defined in your `location` block.
|
Loading…
Reference in a new issue