Howtos/Autoindex on nginx

From creative crowd wiki
< Howtos
Revision as of 14:46, 14 February 2025 by Manetta (talk | contribs) (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! }")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

/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!
}