Learn how to implement rate limiting in NestJS applications using the @nestjs/throttler package. The guide covers core concepts like TTL and request limits, configuring throttle options at global, controller, and route levels, and solving real-world challenges. Advanced topics include tracking clients behind reverse proxies

13m read timeFrom telerik.com
Post cover image
Table of contents
PrerequisitesProject SetupHow Rate Limiting WorksThe @nestjs/throttler ModuleSetting up Some RoutesAdd Rate Limiting to the Entire AppHow Tracking WorksOverriding Rate Limiting Options for Certain RoutesPartly or Completely Disabling Rate Limiting for One or More RoutesRate Limiting Problems in Real World ApplicationsTracking Clients by IP Address When Our Web Server Is Behind a Reverse ProxyUsing a Custom HeaderUsing the X-Forwarded-For Custom HeaderStoring Client Tracking Information Across Multiple InstancesConclusion

Sort: