How to enable directory listing in Nginx

Enabling the Nginx Directory Index Listing



If you are using Nginx web server and you want to display folder in Nginx by web you need to change "autoindex on; in your conf file", By default we can't 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;
        }

}

Linux Guru

Welcome to my Linux blog! Hello Friends, I am Vishal Vyas. I am a DevOps engineer and expert in Linux and Cloud Computing. Also I am a Certified Kubernetes Administrator, I have a total 12 plus years of experience in the IT field and I have worked in various technologies. I write about Linux, AWS, DevOps and web Technologies, I have started this blog to share my technical knowledge with all, I am posting here what I learn from the latest web technologies and the likes.

Post a Comment

Previous Post Next Post