How to enable proxy to get real client Ip using traefik
Hi,
i would like to get the real Ip of the client, i know that i need to enable proxy, i have succesfully done that for nginxi but i don't know how to do that for traefik,
please help
what i have tried is the following
Add this annonation to the LoadBalancer service
service.beta.kubernetes.io/linode-loadbalancer-enable-proxy-protocol: v2
i have enabled proxy v2 in the linode dashboard
i have added the following annonations to my ingress
service.beta.kubernetes.io/linode-loadbalancer-enable-proxy-protocol: v2
traefik.ingress.kubernetes.io/frontend-entry-points: https
traefik.ingress.kubernetes.io/router.entrypoints: web, websecure
use-proxy-protocol: "true"
1 Reply
Hello badrdouah,
Please refer to the documentation below to use proxyprotocol on traefik.
https://doc.traefik.io/traefik/v2.0/routing/entrypoints/
Examples:
File (YAML)
Static configuration
entryPoints:
web:
address: ":80"
proxyProtocol:
trustedIPs:
- "127.0.0.1/32"
- "192.168.1.7"
CLI
--entryPoints.web.address=:80
--entryPoints.web.proxyProtocol.trustedIPs=127.0.0.1/32,192.168.1.7
File (TOML)
Static configuration
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.proxyProtocol]
trustedIPs = ["127.0.0.1/32", "192.168.1.7"]
~ Andy | NexusPIPE