filebrowser/docs

Document how to use reverse proxies without Prefix URL

pjox opened this issue ยท 6 comments

pjox commented

Description
I'm using filebrowser behind an Apache2 reverse proxy. Before I used filebrowser --port 8675 --scope files/ --prefixurl=/files to run filebrowser and it worked perfectly, but after updating to the latest version, and trying to run filebrowser -p 8675 -r files/ -b /files/ it stopped working.

Expected behaviour
Filebrowser serving my files behind the Apache2 reverse proxy.

What is happening instead?
I get a 503 error "Service Unavailable. The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later." for the Apache2 server.

do you mean --baseurl?

pjox commented

Aren't -b and --baseurl the same thing?

you're right, i don't think it exists anymore. i'm using the default root (unspecified, or ".") and a --baseurl of "/filebrowser" so my apache config looks like this:

  <Location "/filebrowser/">
    ProxyPass http://127.0.0.1:8080/filebrowser/
    ProxyPassReverse http://127.0.0.1:8080/filebrowser/
  </Location>

  ProxyPreserveHost On
  RewriteEngine On

  RewriteCond %{HTTP:Connection} Upgrade [NC]
  RewriteCond %{HTTP:Upgrade} websocket [NC]
  RewriteRule (.*) ws://127.0.0.1:8080/$1 [P,L]
pjox commented

This works! Thanks! However, shouldn't it be documented somewhere for the people moving?

It is important to notice that the trailing "/" is needed.

Hello! Yes, there's a bug with the trailing slash being needed and I haven't had time to fix it yet, although all PRs are much more than welcome.

@pjox sorry for not documenting it. I removed it because I noticed it wasn't required since it could be achieved in other ways (such as @nambrosch mentioned).

We also accept documentation PRs ๐Ÿ˜ƒ if you're available to do so @pjox, it'd be more than welcome