Skip to content

Reverse proxy

Aulteran edited this page Nov 6, 2026 · 2 revisions

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 (start here)

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.

  1. Join the proxy's Docker network. If Nginx Proxy Manager runs in Docker, 127.0.0.1:8080 is not reachable from its container. In .env:
    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
    Then start with the proxy override:
    docker compose -f compose.yaml -f docker-compose.proxy.yml up -d --wait
    The proxy forwards to http://web:8080. Only the web container joins the network.
  2. Create a proxy host in Nginx Proxy Manager for your domain, forwarding to web on port 8080 (or filecanopy-web-1).
  3. Request a certificate and turn on Force SSL.
  4. Paste the advanced settings from deploy/proxy/npm-advanced.conf into the proxy host's Advanced tab. They lift the 1 MB upload limit, buffering, and timeouts that would break large uploads.
  5. Set the public address in .env:
    FILECANOPY_PUBLIC_URL=https://files.example.org
    Then run docker compose up -d --wait again.

The three settings that matter

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.

Why the trusted proxy matters

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.

Upload size and timeouts

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.

Other proxies

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.

Clone this wiki locally