Kipple speaks plain HTTP on one port. A reverse proxy (or a tunnel such as Cloudflare Tunnel) adds HTTPS and a public name. This page gives working snippets for Caddy, nginx and Traefik, and says exactly what Kipple believes from a proxy, because a wrong setup does not fail loudly: it makes every visitor look like the proxy.
- What Kipple needs from a proxy
- Find the address to trust
- Caddy
- nginx
- Traefik
- Open mode and proxies
- Check that it works
Serve Kipple at the root of a host (https://kipple.example.com/), not under a subpath such as /kipple/. It builds its
links and API calls from the root, so a subpath breaks the page.
Kipple decides who the client is in one place. A connection from an address that is not in the trusted proxies (Settings, Advanced, Address and access) is the client itself, and every forwarding header it sends is ignored. For a connection from a listed address:
- The client is the rightmost
X-Forwarded-Forhop that is not itself a listed proxy. Each proxy appends the address it received the connection from, so entries further left were written by someone the chain does not vouch for. - With no
X-Forwarded-For,CF-Connecting-IPis the client (Cloudflare Tunnel). X-Forwarded-Proto: httpsmakes the request count as HTTPS (theSecurecookie flag, HSTS, and the scheme in the same-origin check). A request for the exact origin of anhttps://Public URL (its host with no port, or the Public URL's own port) counts as HTTPS too, from any proxy, unless a trusted proxy sendsX-Forwarded-Proto: http.
That client address keys the web sign-in and Reader API login budgets (see "Ports" in deploy.md). So a proxy must:
- Connect from an address you list under Proxy addresses (a single address or a CIDR range, one per line).
- Pass the original
Hostheader through unchanged. Kipple refuses a state-changing request whoseOrigindoes not match the host it was sent to. - Send
X-Forwarded-Forcontaining the address it received the connection from, appended after whatever the client sent, andX-Forwarded-Proto(httpswhen it terminated TLS). - Reach Kipple only through the published port or network you intend: anything else that can connect to Kipple from a listed address can write its own forwarding headers and be believed.
A proxy must not:
- Be listed with a range wider than the proxies themselves. A range wider than an IPv4
/8or an IPv6/20that covers public addresses (0.0.0.0/0,::/0) is refused, per entry: Cloudflare's published ranges all pass. InKIPPLE_TRUSTED_PROXY_IPSsuch a range stops the start when it would be stored, and no address or access setting is stored. The database is already upgraded at that point (on a new version, to the new schema, with the pre-migration snapshot in the backup folder): fix or remove the variable and start again, and restore that snapshot only to go back to the previous version (deploy.md). - Rewrite
Hostto the upstream's address (proxy_set_header Host $proxy_hostin nginx, aHostrewrite in a Caddyheader_up, and so on). - Strip
X-Forwarded-Protowhen it terminates TLS, or forward a client'sX-Forwarded-Protounchanged. Without a trustedhttpsthere, Kipple takes the page for plain http: its cookies are notSecureand use their plain-http names, and the app, which looks for the signed-in marker under the name for the address it was opened at, does not find it and asks Kipple who is signed in on every launch (up to 2 seconds before the app appears). - Buffer or time out the live-update stream
/api/events. Kipple sends a heartbeat every 15 seconds and theX-Accel-Buffering: noheader, so the default timeouts of the proxies below are fine.
Requests larger than 8 MiB are refused for OPML import through the web app, so a proxy body limit of 8 MiB or more is enough.
/api/greader.php is the path sync apps use. It must reach Kipple with the same rules as the rest. If an access layer
such as Cloudflare Access sits in front, that path normally bypasses it, since sync apps cannot sign in to one; Kipple's
Reader API has its own password. A sync client that runs in a browser sends an OPTIONS preflight there first, without
the password; Kipple answers it, so the bypass must cover OPTIONS as well as GET and POST, and the proxy must not
answer it or add CORS headers of its own.
Kipple compresses its responses (gzip) for clients that accept it, so the proxy need not; a proxy that compresses leaves an already compressed response alone.
The address to list is the one Kipple sees as the connection's peer, which in Docker is not always the proxy's own address. The easiest way to learn it is to leave the trusted proxies empty, load the site through the proxy once, and read the log:
docker logs kipple 2>&1 | grep "untrusted peer"
The line is a WARN that names the peer, for example "peer":"172.18.0.1:53422". Take the address without the port
(172.18.0.1) and add it under Proxy addresses in Settings, Advanced, Address and access. It applies at
once. (Kipple logs this warning at most once an hour. For a scripted first start, KIPPLE_TRUSTED_PROXY_IPS=172.18.0.1
in .env seeds the setting.) The usual cases:
- Proxy on the host, Kipple published on
127.0.0.1:1919. Kipple sees the Docker bridge gateway, for example172.18.0.1. The published port is reachable from this machine only, so listing the gateway is safe. - Proxy in a container on the same Docker network as Kipple, Kipple not published. Kipple sees the proxy container's address. List that address, or the network's subnet when it is a network only your containers join.
- Cloudflare Tunnel (
cloudflared). List the addresscloudflaredconnects from. Kipple readsCF-Connecting-IPfrom it.
Also set the Public URL in the same place (for example https://rss.example.com; the setup wizard asks for it too)
so sync clients get feed icons and the name passes the Host check.
rss.example.com {
reverse_proxy 127.0.0.1:1919
}
reverse_proxy passes Host through, appends the client address to X-Forwarded-For, and sets X-Forwarded-Proto
and X-Forwarded-Host; it does not trust those headers from clients unless you configure trusted_proxies. Leave that
unset. With Caddy and Kipple in containers on one network, use the service name instead: reverse_proxy kipple:1919.
server {
listen 443 ssl;
server_name rss.example.com;
# ssl_certificate and ssl_certificate_key as usual
client_max_body_size 8m;
location / {
proxy_pass http://127.0.0.1:1919;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
$proxy_add_x_forwarded_for appends the connecting address to whatever the client sent, which is what Kipple expects.
$http_host keeps the port when you serve on a non-standard one. Do not set X-Forwarded-For to $remote_addr alone on
a proxy that sits behind another proxy: it discards the chain.
With Docker labels, Traefik and Kipple on the same network and Kipple not published:
services:
kipple:
image: ghcr.io/wptk/kipple:<version>
container_name: kipple
volumes: ["kipple_data:/data"]
networks: [proxy]
labels:
- traefik.enable=true
- traefik.http.routers.kipple.rule=Host(`rss.example.com`)
- traefik.http.routers.kipple.entrypoints=websecure
- traefik.http.routers.kipple.tls.certresolver=letsencrypt
- traefik.http.services.kipple.loadbalancer.server.port=1919
# the other settings of docker-compose.pull.example.yml go here as well
networks:
proxy:
external: true
Traefik passes Host, appends the client to X-Forwarded-For and sets X-Forwarded-Proto. Leave the entry point's
forwardedHeaders.insecure at its default (off) unless a proxy of your own sits in front of Traefik, in which case list
that proxy under forwardedHeaders.trustedIPs and add its address to Kipple's list too. Kipple sees Traefik's address
on the shared network: find it as above and add it to the trusted proxies.
Open mode (no password) refuses any request that came through a proxy or tunnel, and treats a connection from a listed proxy address the same way, so it fails closed. Use a password if Kipple sits behind a proxy. The exact rule is in deploy.md.
- Sign in through the public address. If sign-in works but changing anything answers
403,HostorX-Forwarded-Protois wrong (see troubleshooting.md). docker logs kippleshows nountrusted peerwarning after a few requests.- Open
https://rss.example.com/api/greader.php/check/compatibility: it answersPASS.