Seafile Behind a Caddy Reverse Proxy not on localhost


So I got Seafile up and running on a virtual machine of mine and I am trying to use caddy as a reverse proxy for it but the problem is that its not on local host of Seafile its in its own virtual machine. I can access the Seafile interface and download the doc but when I want to upload something to the server I get a network error and I believe it has to do with not specifying what the /media directory should proxy to. Now everything I look up on Caddy(even NGINX and Apache for that matter) as a reverse proxy for Seafile I always get examples for them on the local host. So I am wondering if anyone knows how to set up my caddy file to proxy the location of the media directory to a different host from local?

Here is my caddyfile below never mind the /request proxy thats going to another site. {
   proxy /request internalip:3700 {
   proxy / internalip:8000 {
   proxy /seafhttp internalip:8082 {
      without /seafhttp

Almost all configuration applies equally to localhost and external hosts. The only difference in Caddy’s configuration should be that the upstream server you’re proxying to is specified as the external host instead of localhost or etc.

You’ll need to make sure that all the URIs that Seafile uses are properly proxied to the Seafile host.

Okay so this is what I’m missing from the example below. {
    root /home/user/haiwen/seafile-server-latest/seahub/media

So how would I send that off from local host to another ip and am I misunderstanding something?

If you’re not hosting the files locally any more, so you need to proxy to a web server that is, just like the proxies in your original post.

The example you just gave would be the kind of the config you’d run on Caddy on the other host, responding to the Caddy proxying to it.

hmmm so i just need to figure out what that 3rd option is on the seafile built in webserver so i can proxy the media requests to it from caddy?

There needs to be some kind of web server serving up the files. Either Caddy needs to do it off disk, or Caddy needs to proxy to a webserver that does serve them off disk.

Whether that’s Seafile’s built in webserver and you proxy from Caddy to that, or whether you set up another Caddy on the Seafile host - I’m not sure what’s most feasible.

but i would have like 2 proxy caddy proxys then in a row basically.

Nothing particularly wrong with that.

It’s just a consequence of having the files on a different host.

Far more complicated proxy chains have been deployed in the past, and will be deployed in future. I frequently proxy from Caddy to other Caddies or nginx’s or Apaches or just other Go web apps in Docker containers.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.