Skip to content

rate_limit

rate_limit limits request throughput using github.com/rakunlabs/ada/middleware/ratelimit.

yaml
server:
  http:
    middlewares:
      limit_by_ip:
        rate_limit:
          limit_type: ip
          requests: 100
          duration: 1m
FieldDefaultDescription
limit_typeallall, ip, or realip.
requests100Number of requests allowed per duration.
duration1mRate-limit window.

realip keys on proxy-supplied headers (True-Client-IP, X-Real-IP, then the left-most X-Forwarded-For), falling back to the connection address. Make sure trusted proxy headers are correct before relying on it.