自分なりのベストプラクティス

クライアント - Cloudflare - Caddy - Misskeyバックエンド
の構成

Caddyでは、リクエストがCloudflareのIPレンジからであれば X-Forwarded-ForCF-Connecting-IP で上書きし、そうでなければ X-Forwarded-For をリクエスト元のIPで上書きする。そこまで設定できたらMisskeyで trustProxy: true する。
1

If you have a fediverse account, you can quote this note from your own instance. Search https://misskey.ihoronir.com/notes/aga905vaiq on your instance and quote it. (Note that quoting is not supported in Mastodon.)