Skip to content

rate_limit

rate_limit limits request throughput using github.com/go-chi/httprate.

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 uses chi's real-IP behavior. Make sure trusted proxy headers are correct before relying on it.