Commit 6419b10
committed
Set Express 'trust proxy' to 1 for rate limiting behind Render's proxy
Render forwards the client IP via X-Forwarded-For through a single reverse
proxy. With Express's default trust proxy=false, express-rate-limit throws
ERR_ERL_UNEXPECTED_X_FORWARDED_FOR and cannot key requests by client IP.
Trusting exactly one proxy hop resolves the error without trusting a
spoofable header chain. Verified: a request with X-Forwarded-For to the
rate-limited /api/login route no longer throws.1 parent c6201e2 commit 6419b10
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
175 | 181 | | |
176 | 182 | | |
177 | 183 | | |
| |||
0 commit comments