Skip to content

Reverse Proxy Setup

When deploying FynnCloud behind an existing TLS reverse proxy (Nginx, Caddy, Traefik, HAProxy, or Cloudflare Tunnel), configure your proxy to handle large streaming uploads, WebSockets (Talk, LiveKit, EuroOffice), Server-Sent Events (/api/events, /api/sync/events, AI streaming), and forwarded client IPs.

Routing Model: Subpaths vs Custom Subdomains

Section titled “Routing Model: Subpaths vs Custom Subdomains”

When running fynncloud-aio setup --behind-proxy, AIO binds its internal Caddy router to 127.0.0.1:11000 (configurable via --bind-address and --http-port) and routes everything through one port:

  • https://cloud.example.com/ → Web UI & REST API (/api/*)
  • https://cloud.example.com/eurooffice/* → EuroOffice (default when components.eurooffice.domain is empty)
  • wss://cloud.example.com/livekit/* → LiveKit signaling (default when components.livekit.domain is empty)

In standalone Docker Compose, fynncloud-proxy listens on ${PROXY_PORT:-80} (serving / and /api/*) while optional fynncloud-eurooffice listens on its own host port (${EUROOFFICE_PORT:-8082}). Proxy either a separate subdomain (office.cloud.example.com → 127.0.0.1:8082) or a /eurooffice prefix to port 8082.


FynnCloud Server ignores X-Forwarded-For and X-Real-IP unless the connecting proxy’s TCP peer IP matches SERVER_TRUSTED_PROXIES (comma-separated IPs/CIDRs, e.g. 127.0.0.1/32,172.16.0.0/12). Without this setting, rate limiting (RATE_LIMIT_AUTH, RATE_LIMIT_API) sees your reverse proxy’s IP for every user and will throttle all users together!

  • In AIO: set ingress.trusted_proxies: ["127.0.0.1/32", "172.16.0.0/12"] in /data/stack.yaml (or via Admin UI / reconcile).
  • In Compose / Kubernetes: set SERVER_TRUSTED_PROXIES=127.0.0.1/32,172.16.0.0/12 (adjust to your proxy/ingress CIDR).
  • Behind Cloudflare: add Cloudflare’s edge CIDRs (or your cloudflared tunnel host IP) to SERVER_TRUSTED_PROXIES and set TRUST_CLOUDFLARE_HEADERS=true so FynnCloud honors CF-Connecting-IP / True-Client-IP.

Nginx must disable both response buffering (proxy_buffering off;, required for SSE and AI streaming) and request buffering (proxy_request_buffering off;, required so chunked uploads stream straight through instead of filling Nginx’s temporary disk):

map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name cloud.example.com;
ssl_certificate /etc/letsencrypt/live/cloud.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cloud.example.com/privkey.pem;
# Must be >= FynnCloud MAX_BODY_SIZE / STORAGE_MAX_CHUNK_SIZE (default 100m), or 0 for unlimited
client_max_body_size 0;
location / {
proxy_pass http://127.0.0.1:11000; # Use 127.0.0.1:8080 for standalone Compose
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
# WebSocket upgrades (Talk, LiveKit /livekit, EuroOffice /eurooffice)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# Critical: stream large uploads and SSE (/api/events, /api/sync/events, AI) without buffering
proxy_buffering off;
proxy_request_buffering off;
# Long-lived SSE, WebSockets, and slow chunk uploads (matches 30m app proxy timeout)
proxy_read_timeout 1800s;
proxy_send_timeout 1800s;
proxy_connect_timeout 60s;
}
}

If using standalone Docker Compose with EuroOffice on a separate subdomain (office.cloud.example.com):

server {
listen 443 ssl http2;
server_name office.cloud.example.com;
ssl_certificate /etc/letsencrypt/live/office.cloud.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/office.cloud.example.com/privkey.pem;
client_max_body_size 100m;
location / {
proxy_pass http://127.0.0.1:8082;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_buffering off;
proxy_request_buffering off;
proxy_read_timeout 3600s;
}
}

Caddy automatically negotiates WebSockets, streams request/response bodies, and manages Let’s Encrypt certificates. Set flush_interval -1 so SSE events flush immediately:

cloud.example.com {
reverse_proxy 127.0.0.1:11000 {
flush_interval -1
header_up Host {host}
header_up X-Forwarded-Proto {scheme}
header_up X-Real-IP {remote_host}
}
}

For standalone Docker Compose with a separate EuroOffice subdomain:

office.cloud.example.com {
reverse_proxy 127.0.0.1:8082 {
flush_interval -1
}
}

Traefik v3 Configuration (Dynamic File Provider)

Section titled “Traefik v3 Configuration (Dynamic File Provider)”
http:
routers:
fynncloud:
rule: "Host(`cloud.example.com`)"
entryPoints:
- websecure
tls:
certResolver: letsencrypt
service: fynncloud
services:
fynncloud:
loadBalancer:
passHostHeader: true
responseForwarding:
flushInterval: "-1ms"
servers:
- url: "http://127.0.0.1:11000"