Hi,
I have a Docker Swarm behind an AWS ELB. Traefik and a service displaying HTTP Headers are running.
Here is my config:
version: "3.3"
services:
traefik:
image: traefik:2.1
command:
- "--providers.docker=true"
- "--providers.docker.swarmmode=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entryPoints.web.forwardedHeaders.insecure"
- "--entryPoints.web.proxyProtocol.insecure"
- "--entrypoints.web.transport.respondingtimeouts.idletimeout=0"
- "--serverstransport.forwardingtimeouts.dialtimeout=0"
- "--log.level=INFO"
- "--log.filePath=/var/log/traefik/access.log"
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
labels:
- "traefik.enable=false"
networks:
- public
deploy:
mode: global
placement:
constraints:
- node.role == manager
networks:
public:
driver: overlay
The HTTP Headers service
debugheaders:
image: mendhak/http-https-echo
deploy:
replicas: 1
labels:
- traefik.enable=true
- "traefik.http.services.debugheaders.loadbalancer.server.port=80"
- "traefik.http.routers.debugheaders.rule=Host(`test.com`)"
- "traefik.http.routers.debugheaders.priority=0"
- "traefik.http.services.debugheaders.loadbalancer.sticky=true"
- "traefik.docker.network=public"
placement:
constraints: [node.role==worker]
networks:
- public
The issue is I'm not getting the Real IP in the X-Forwarded-For header, what I am missing?
Thanks