Added nginx config

This commit is contained in:
2020-10-07 21:57:56 +00:00
parent 8a1f304f07
commit 0064ecbb34

View File

@@ -1,11 +1,42 @@
# NginxAutoIndex # NginxAutoIndex
## General setup ## General setup
run the following commands Run the following commands
``` ```
mkdir -p /var/www/autoindexTheme mkdir -p /var/www/autoindexTheme
wget https://git.bprieshof.nl/DarkTheme/NginxAutoIndex/raw/branch/main/theme.html -O /var/www/autoindexTheme/theme.html wget https://git.bprieshof.nl/DarkTheme/NginxAutoIndex/raw/branch/main/theme.html -O /var/www/autoindexTheme/theme.html
``` ```
## Setup Auto Index as nginx root ## Setup Auto Index as nginx root
Nginx site config-file
```
location /downloads/theme/ {
alias /var/www/autoindexTheme/;
}
## Setup Auto Index as nginx sub-dir 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;
}
```