Eric Guo's

Hoping writing JS, Ruby & Rails and Go article, but fallback to DevOps note

Enable Directory Listing in Nginx


Step 1, setting the autoindex on in conf

server {
listen 80;
server_name cvpforms; #replace your DNS name
rails_env development; #development/production
root /var/rails_apps/pl-form/public;
passenger_enabled on;
client_max_body_size 5m;
location /rf_image {
autoindex on;
autoindex_exact_size off;

Step 2, resolve the 403 forbidden error using below command if you meet such error.

chmod 755 * -R # in /home/pl-form/pl-form/public/rf_image