Howtos/Autoindex on nginx: Difference between revisions

From creative crowd wiki
Jump to navigation Jump to search
(Created page with "You can activate autoindex on the main server folder (<code>/var/www/html/</code>) and/or home folders (<code>~/public_html/</code>). ==/var/www/html/== ==~/public_html/== location ~ ^/~(.+?)(/.*)?$ { alias /home/$1/public_html$2; index index.php index.html index.htm; autoindex on; # this feature automatically lists all files in the public_html folder! }")
 
No edit summary
Line 1: Line 1:
You can activate autoindex on the main server folder (<code>/var/www/html/</code>) and/or home folders (<code>~/public_html/</code>).
You can activate autoindex on the main server folder (<code>/var/www/html/</code>) and/or home folders (<code>~/public_html/</code>).


==/var/www/html/==
==autoindex==


===/var/www/html/===




==~/public_html/==
 
===~/public_html/===


  location ~ ^/~(.+?)(/.*)?$ {
  location ~ ^/~(.+?)(/.*)?$ {
Line 12: Line 14:
     autoindex on; # this feature automatically lists all files in the public_html folder!
     autoindex on; # this feature automatically lists all files in the public_html folder!
  }
  }
==fancyindex !==
https://nginx-extras.getpagespeed.com/modules/fancyindex/

Revision as of 14:49, 14 February 2025

You can activate autoindex on the main server folder (/var/www/html/) and/or home folders (~/public_html/).

autoindex

/var/www/html/

~/public_html/

location ~ ^/~(.+?)(/.*)?$ {
    alias /home/$1/public_html$2;
    index index.php index.html index.htm;
    autoindex on; # this feature automatically lists all files in the public_html folder!
}

fancyindex !

https://nginx-extras.getpagespeed.com/modules/fancyindex/