Added nginx config
This commit is contained in:
35
README.md
35
README.md
@@ -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;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user