Commit 574dffc
committed
fix: set trust proxy to 2 for Cloudflare + nginx chain (#507)
express-rate-limit v8.4+ rejects `trust proxy = true` because it allows
anyone to spoof X-Forwarded-For and bypass rate limiting
(ERR_ERL_PERMISSIVE_TRUST_PROXY). Setting it to 2 trusts exactly the two
known proxy hops (Cloudflare → nginx → Express) while still resolving
the correct client IP for logging and rate limiting.1 parent 9a1b077 commit 574dffc
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments