qisong
1
version: 2.16
providers: kubernetes-crd
flow: client(10.1.1.2) -> elb(10.2.2.2) -> nginx(10.3.3.3) -> traefik(10.4.4.3) -> app
traefik host tcpdump:
X-Forwarded-For: 10.1.1.2,10.2.2.2,10.3.3.3
app host tcpdump
X-Forwarded-For: 10.3.3.3
Remoteip: 181.61.57.169
how to config traefik or router, traefik keep all ip in X-Forwarded-For for app.
ldez
2
qisong
3
taefik.toml
[entrypoints]
[entrypoints.web]
Address = ":8000"
[entryPoints.web.forwardedHeaders]
insecure = true
[entrypoints.websecure]
Address = ":4443"
[entryPoints.websecure.forwardedHeaders]
insecure = true
app get Header:
Hostname: whoami-5df4df6ff5-5zssq
IP: 127.0.0.1
IP: 172.12.7.234
RemoteAddr: 172.12.0.131:58316
GET /notls HTTP/1.1
Host: your.domain.com
User-Agent: PostmanRuntime/7.23.0
Accept: */*
Accept-Encoding: gzip, deflate, br
Cache-Control: no-cache
Myheader: ddddddd
Postman-Token: d944c480-5579-44d2-a371-d62a7b833ef0
X-Forwarded-For: 10.3.3.3
X-Forwarded-Host: your.domain.com
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: hostname
X-Real-Ip: 10.3.3.3
X-Ruxit-Forwarded-For: 10.1.1.2, 10.1.1.2
I can not get X-Forwarded-For: 10.1.1.2,10.2.2.2,10.3.3.3