Skip to content

jeremywmoore/traefik-real-ip-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Traefik plugin to retrieve client IPs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%