Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 1.63 KB

README.md

File metadata and controls

59 lines (47 loc) · 1.63 KB

traefik-real-ip-plugin

Tag Badge Go Version Badge Go Report Card Badge

Traefik plugin to retrieve client IPs. Supports retrieving the IP from and writing the result to arbitrary headers.

If a list or a count of trusted proxies is specified, the header is parsed with the same format as the X-Forwarded-For header (1.2.3.4, 1.2.3.5, ...). Otherwise, the entire header is parsed as an IP.

The first valid IP retrieved is written to the configured destination headers.

Traefik static configuration

experimental:
  plugins:
    realip:
      moduleName: github.com/Desuuuu/traefik-real-ip-plugin
      version: v1.0.1

Dynamic configuration

Trusted CIDRs

http:
  middlewares:
    realip:
      plugin:
        realip:
          retrievers:
            - header: X-Forwarded-For
              proxyCIDRs:
                - "203.0.113.195/24"
          headers:
            - X-Real-IP

Trusted count

http:
  middlewares:
    realip:
      plugin:
        realip:
          retrievers:
            - header: X-Forwarded-For
              proxyCount: 1
          headers:
            - X-Real-IP