Enabling the Nginx Directory Index Listing
Nginx is a popular web server that can also be used as a reverse proxy, caching, load balancing, and for other purposes. In this post, I'll show you how to enable and disable directory listing.
If you are using Nginx web server and want to display folder in Nginx by web, you must change "autoindex on;" in your conf file. By default, we cannot open directory from Nginx web.
Enable Directory listing : Open your nginx conf file and change.
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
autoindex on; #for enable directory listing
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
How to disable Directory Indexing in Nginx.
Here is the simple step to disable directory listing in Nginx. Go to the Nginx configuration file and turn off the indexing.
autoindex off;
You might be interested in this article :How to setup Nginx ingress using helm