Rate limit by IP in Express and Nginx (without limiting your own proxy)
Per-IP rate limits fail in two opposite ways behind a proxy: every user shares the proxy's bucket, or every attacker gets a fresh one by forging X-Forwarded-For. Here is a setup for Express and Nginx that avoids both, tested against real requests.