Repository navigation
Reverse proxy
The web container listens on 127.0.0.1:8080 only. To reach FileCanopy from other devices, put a reverse proxy with HTTPS in front of it. Tested configurations for Nginx Proxy Manager, nginx, Caddy, Traefik and Cloudflare Tunnel are in deploy/proxy/.
Nginx Proxy Manager is the first setup we document, because it is common on home labs. Its directives are tested in plain nginx, not in Nginx Proxy Manager itself.
-
Join the proxy's Docker network. If Nginx Proxy Manager runs in Docker,
127.0.0.1:8080is not reachable from its container. In.env:Then start with the proxy override:FILECANOPY_PROXY_NETWORK=proxy # name from `docker network ls` FILECANOPY_TRUSTED_PROXIES=172.18.0.0/16 # that network's subnet, or the proxy's own address
The proxy forwards todocker compose -f compose.yaml -f docker-compose.proxy.yml up -d --wait
http://web:8080. Only the web container joins the network. -
Create a proxy host in Nginx Proxy Manager for your domain, forwarding to
webon port8080(orfilecanopy-web-1). - Request a certificate and turn on Force SSL.
-
Paste the advanced settings from
deploy/proxy/npm-advanced.confinto the proxy host's Advanced tab. They lift the 1 MB upload limit, buffering, and timeouts that would break large uploads. -
Set the public address in
.env:Then runFILECANOPY_PUBLIC_URL=https://files.example.org
docker compose up -d --waitagain.
| Setting | What to put there |
|---|---|
FILECANOPY_PUBLIC_URL |
The address people type, for example https://files.example.org. No path. |
FILECANOPY_TRUSTED_PROXIES |
The proxy's address as the web container sees it. Only these addresses are believed about the visitor. |
FILECANOPY_COOKIE_SECURE |
Keep true. |
Turn on FILECANOPY_HSTS=true only after HTTPS works for good.
FileCanopy reads the visitor's address from X-Forwarded-For only from trusted proxies. If the list is empty, every visitor looks like the proxy: the sign-in limit is shared, and the audit log shows the proxy's address.
- Trust the proxy's own single address where you can, for example
172.18.0.5. Give the proxy a fixed address if you can. - Do not trust a wide range. Every container in it could claim any visitor address. Ranges wider than /8 (IPv4) or /16 (IPv6), such as
0.0.0.0/0, are refused and the container will not start. - If a CDN sits in front of your proxy, add its addresses too, or have the proxy set the real address for you.
To check, sign in with a wrong password and look at the newest login.failed row in the audit table. Its ip should be your own address, not the proxy's.
Uploads are streamed in one request, up to FILECANOPY_MAX_UPLOAD_BYTES (10 GiB by default). The proxy must allow that. nginx and Nginx Proxy Manager default to a 1 MB body limit and buffer uploads to disk, so the advanced settings above remove both limits and raise the timeouts.
Cloudflare's proxy also has its own upload limit. For large files, use a route that does not pass through it, or upload over the local network.
Caddy, Traefik, nginx and Cloudflare Tunnel have ready configurations in deploy/proxy/. Use deploy/proxy/README.md for each. The Compose tests cover nginx, Caddy and Traefik. Cloudflare Tunnel needs a Cloudflare account and was not tested.