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;
        }

}

Comments

Popular posts from this blog

Another instance of Certbot is already running - Solved - Linux guru

Install Apache Using Ansible Playbooks

Setup password less SSH on linux

Create aws s3 bucket using cli

Secure nginx with Let's Encrypt on Ubuntu 18.04