docs icon indicating copy to clipboard operation
docs copied to clipboard

Document how to use reverse proxies without Prefix URL

Open pjox opened this issue 6 years ago • 6 comments
trafficstars

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.

pjox avatar Mar 21 '19 10:03 pjox

do you mean --baseurl?

nambrosch avatar Mar 21 '19 13:03 nambrosch

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

pjox avatar Mar 21 '19 14:03 pjox

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]

nambrosch avatar Mar 21 '19 14:03 nambrosch

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

pjox avatar Mar 21 '19 16:03 pjox

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

marcenuc avatar Apr 15 '19 10:04 marcenuc

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

hacdias avatar Apr 20 '19 18:04 hacdias