diff --git a/README.md b/README.md index dc8609b..9e0045d 100644 --- a/README.md +++ b/README.md @@ -183,7 +183,7 @@ systemctl daemon-reload systemctl enable --now im ``` -Put a TLS-terminating reverse proxy in front of it. `deploy/ferron.kdl` is an example Ferron site that +Put a TLS-terminating reverse proxy in front of it. `deploy/ferron.conf` is an example Ferron site that forwards to `127.0.0.1:7650`; `base_url` must be the same public origin. Three things matter in the proxy: - Redirect plain HTTP to HTTPS. `im` sends HSTS itself when `base_url` is `https://`. diff --git a/deploy/ferron.conf b/deploy/ferron.conf new file mode 100644 index 0000000..fb0c295 --- /dev/null +++ b/deploy/ferron.conf @@ -0,0 +1,20 @@ +# Ferron reverse proxy for im. Same format as the forge and iz examples (ferron.conf, not KDL). +# Replace im.example.com with the public host name (base_url in /etc/im/im.toml must match it). +# A bare host block gets automatic TLS. +# +# The proxy sends X-Forwarded-For for the client. im reads that header only from peers listed in +# trusted_proxies; with Ferron on the same machine the peer is 127.0.0.1, so set +# trusted_proxies = ["127.0.0.1/32"] in im.toml. Left empty, every visitor counts as 127.0.0.1 and one +# visitor's failures throttle everyone. +# +# Buffering is off because the live update streams (server-sent events) must reach the browser +# as they are written. +# +# Keep /reset/, /invite/ and /email/ out of the access log: those paths carry tokens that grant access. +im.example.com { + buffer_request 0 + buffer_response 0 + proxy { + upstream http://127.0.0.1:7650 + } +} diff --git a/deploy/ferron.kdl b/deploy/ferron.kdl deleted file mode 100644 index 6485726..0000000 --- a/deploy/ferron.kdl +++ /dev/null @@ -1,9 +0,0 @@ -// Example Ferron site for `im`. Ferron terminates TLS and forwards to the loopback listener of `im`. -// Check the directive names against the Ferron version you run; this file shows the shape, it has not been -// run against a live Ferron here. `base_url` in im.toml must be this same origin, and `trusted_proxies` -// must be ["127.0.0.1/32"]. In the real site also: redirect HTTP to HTTPS, do not buffer responses (the -// live streams need it), append the client to X-Forwarded-For, and keep /reset/, /invite/ and /email/ paths -// out of the access log: they carry one-time tokens. -im.example.com { - proxy http://127.0.0.1:7650 -}