Traefik EntryPoints support ProxyProtocol which enables a load balancer to forward (encrypted) connections and still let Traefik know the original originating IP.
--entrypoints.web.address=:80
--entrypoints.web.http.redirections.entryPoint.to=websecure
--entrypoints.web.http.redirections.entryPoint.scheme=https
--entrypoints.web.proxyProtocol.trustedIPs=1.2.3.4,5.6.7.8
--entrypoints.websecure.address=:443
--entrypoints.websecure.proxyProtocol.trustedIPs=1.2.3.4,5.6.7.8
Is there a way for Traefik to add the load balancers IP (the direct source of the incoming ProxyProtocol connection) to the HTTP headers, to get something like x-forwarded-proxy: 1.2.3.4
? We would like to see if all load balancers are actually working.
Just linking the issue you opened as it was accepted as a valid proposal to help other people track it:
opened 07:26PM - 31 Aug 22 UTC
kind/proposal
area/server
### Welcome!
- [X] Yes, I've searched similar issues on [GitHub](https://github… .com/traefik/traefik/issues) and didn't find any.
- [X] Yes, I've searched similar issues on the [Traefik community forum](https://community.traefik.io) and didn't find any.
### What did you expect to see?
We run multiple Traefik instances behind a load balancer using ProxyProtocol.
```
entryPoints:
web:
address: :80
proxyProtocol:
insecure: true
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: :443
proxyProtocol:
trustedIPs:
- 1.2.3.4
- 5.6.7.8
```
It would be great if Traefik could add the IP of the ProxyProtocol host to the HTTP headers, so our app can see which load balancer was used for the request.
```
Hostname: myhost
IP: 127.0.0.1
IP: 10.0.16.28
IP: 172.19.0.5
RemoteAddr: 10.0.16.26:42274
GET / HTTP/1.1
Host: myhost.example.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:103.0) Gecko/20100101 Firefox/103.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Upgrade-Insecure-Requests: 1
X-Forwarded-For: 67.78.89.90
X-Forwarded-Host: myhost.example.com
X-Forwarded-Port: 443
X-Forwarded-Proto: https
X-Forwarded-Server: myhost
X-Forwarded-Proxy: 1.2.3.4 <====================
X-Real-Ip: 67.78.89.90
```
1 Like