mirror of
https://github.com/gtsteffaniak/filebrowser.git
synced 2026-11-26 00:19:41 -05:00
Co-authored-by: Markos <xmarkos@gmail.com> Co-authored-by: Zhiyuan Zheng <zhzy0077@hotmail.com> Co-authored-by: Kurami <kurami32_kbm@proton.me> Co-authored-by: MrPanda376 <112415827+MrPanda376@users.noreply.github.com> Co-authored-by: MrPanda376 <luca.silvestrin.2008@gmail.com>
33 lines
1001 B
Plaintext
33 lines
1001 B
Plaintext
|
|
map $remote_addr $uuid {
|
|
default "demo-${remote_addr}";
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost 127.0.0.1;
|
|
|
|
location /subpath/public/ {
|
|
proxy_pass http://filebrowser:8080/subpath/public/;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Username $uuid;
|
|
}
|
|
|
|
# requires basic auth demo-127.0.0.1:SecurePass123!
|
|
location /subpath {
|
|
auth_basic "Restricted Access";
|
|
auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
|
|
proxy_set_header X-Username $uuid;
|
|
add_header X-Username $uuid;
|
|
proxy_pass http://filebrowser:8080/subpath;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
}
|