Can't access Cells behind a Caddy reverse proxy

I’m trying to use Caddy to reverse proxy Pydio Cells (separate from the one build into Cells). I have Cells set to localhost:8080 with SSL Disabled, so port 80 and 443 are free for Caddy to use.

This Pydio Cells document suggests what I’m trying to do is possible, but I haven’t gotten anywhere using the provided Caddyfile, as pydio.example.com returns with error 404. I’ve also tried 0.0.0.0:8080 but I end up with an endless loading screen.

I’ve been trying to figure this out for ages, if someone could help that’d be great! :slight_smile:

Caddyfile:

https://pydio.example.com:443 {

    log stdout

    timeouts 0

    proxy / http://localhost:8080 {
        insecure_skip_verify
        transparent
        websocket
    }

    tls {
        dns cloudflare
    }

}

Hello @vustom,

With the same Caddyfile as you showed me in your post,
Could you please modify your urlInternal setting in the pydio.json to one of those 2 values:

and restart your Cells.

Hey @zayn, thanks for the quick reply!

Edit 2: After some more trial and error, I got it working using this setup:

Configure Cells install with:

Internal Url: pydio.example.com:8080
Self-signed: Y
Bind to port 80: N
External Url: https://pydio.example.com (Remove :8080 if present)

Then change http://localhost:8080 to https://localhost:8080 in Caddyfile.

This was clearer in this Pydio document outlining an example Apache reverse proxy, I just didn’t put the two together till reading that wiki post.

1 Like

I managed to get Cells working using localhost:8080 as the Internal Url.

On install, choose the following:

Internal Url: localhost:8080
External Url: https://pydio.example.com (Remove :8080 if present)

Then set header_upstream Host to localhost in Caddyfile (If preferred, {>host} works instead of localhost). I’m pretty sure leaving transparent in continues to pass the other headers. End result should be:

proxy / https://localhost:8080 {
    insecure_skip_verify
    transparent
    header_upstream Host localhost
    websocket
}

@zayn

Do you think this config is preferable over having the FQDN as Internal Url?

Hello,

in such a vanillasetup with a Cells instance behnd a Caddy reverse proxy on a single machine, we usually recommand to use
Internal URL: pydio.example.com:8080
ExternalURL: https://pydio.example.com

And for the caddy file:

proxy / http://localhost:8080 {
    transparent
    websocket
}

=> using a TLS connection locally between your reverse proxy and Cells has a cost and I don’t really see the point if your server is secured
=> having the normal transparent directive is required for the integration with other services like webdav to work smoothly