https://github.com/desuuuu/traefik-real-ip-plugin
Traefik plugin to retrieve client IPs.
https://github.com/desuuuu/traefik-real-ip-plugin
traefik traefik-plugin
Last synced: about 1 year ago
JSON representation
Traefik plugin to retrieve client IPs.
- Host: GitHub
- URL: https://github.com/desuuuu/traefik-real-ip-plugin
- Owner: Desuuuu
- License: mit
- Created: 2022-12-07T16:18:42.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-29T15:55:41.000Z (almost 3 years ago)
- Last Synced: 2024-06-21T04:48:47.131Z (about 2 years ago)
- Topics: traefik, traefik-plugin
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traefik-real-ip-plugin
[![Tag Badge]][Tag] [![Go Version Badge]][Go Version] [![Go Report Card Badge]][Go Report Card]
Traefik plugin to retrieve client IPs. Supports retrieving the IP from and writing the result to arbitrary headers.
If a depth or a list of excluded CIDRs 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
```yaml
experimental:
plugins:
realip:
moduleName: github.com/Desuuuu/traefik-real-ip-plugin
version: v1.1.0
```
## Dynamic configuration
### Depth
```yaml
http:
middlewares:
realip:
plugin:
realip:
retrievers:
- header: X-Forwarded-For
depth: 1
headers:
- X-Real-IP
```
### Excluded CIDRs
```yaml
http:
middlewares:
realip:
plugin:
realip:
retrievers:
- header: X-Forwarded-For
excludedCIDRs:
- "203.0.113.195/24"
headers:
- X-Real-IP
```
[Tag]: https://github.com/Desuuuu/traefik-real-ip-plugin/tags
[Tag Badge]: https://img.shields.io/github/v/tag/Desuuuu/traefik-real-ip-plugin?sort=semver
[Go Version]: /go.mod
[Go Version Badge]: https://img.shields.io/github/go-mod/go-version/Desuuuu/traefik-real-ip-plugin
[Go Report Card]: https://goreportcard.com/report/github.com/Desuuuu/traefik-real-ip-plugin
[Go Report Card Badge]: https://goreportcard.com/badge/github.com/Desuuuu/traefik-real-ip-plugin