From 0064ecbb3417f145402a3190f847fbb992560a3c Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 7 Oct 2020 21:57:56 +0000 Subject: [PATCH] Added nginx config --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 33ed275..6d36fc6 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,42 @@ # NginxAutoIndex ## General setup -run the following commands +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/; + } -## Setup Auto Index as nginx sub-dir \ No newline at end of file + 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; + } +```