# NginxAutoIndex ## General setup Run the following commands ``` mkdir -p /var/www/autoindexTheme wget https://git.bprieshof.nl/DarkTheme/NginxAutoIndex/raw/branch/main/theme.html -O /var/www/autoindexTheme/theme.html ``` ## Setup Auto Index as nginx root Nginx site config-file ``` location /downloads/theme/ { alias /var/www/autoindexTheme/; } location /downloads{ alias /var/www/downloads/; add_before_body "/downloads/theme/theme.html"; autoindex on; autoindex_localtime on; autoindex_exact_size off; } ``` ## Setup Auto Index as nginx sub-dir Nginx site config-file ``` root /var/www/downloads location /theme/ { alias /var/www/autoindexTheme/; } location / { add_before_body "/theme/theme.html"; autoindex on; autoindex_localtime on; autoindex_exact_size off; } ```