user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; server { listen 80; location / { root /usr/share/nginx/html; index index.html index.htm; autoindex on; # Enable directory listing } # Proxying /browser to filebrowser:8080 location /b { rewrite ^/b(.*) $1 break; # Remove /browser prefix from the URL sub_filter_once off; sub_filter_types text/html; sub_filter "/static" "/b/static"; sub_filter "/api" "/b/api"; proxy_pass http://fileshare-filebrowser-1:8080; 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_hide_header X-Frame-Options; proxy_hide_header X-Content-Type-Options; proxy_hide_header X-XSS-Protection; auth_basic off; # Turn off authentication for this location } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } }