title: Nginx behind Traefik Docker Swarm mode real ip
body: <p>I'm using Traefik as a reverse proxy in front of nginx service on a docker swarm environment. Here's my docker-stack.yml:</p>
  
  <pre><code>traefik:
      image: traefik
      command: -c /dev/null --web --docker --docker.swarmmode --docker.watch --docker.domain=domain --logLevel=DEBUG
      ports:
        - "8080:8080"
        - "80:80"
        - "443:443"
      networks:
         - app
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
      deploy:
        placement:
          constraints: [node.role == manager]
  
  nginx:
      image: nginx
      networks:
        - app
      deploy:
        labels:
          traefik.port: 80
          traefik.docker.network: app
          traefik.frontend.rule: "Host:app.domain"
  </code></pre>
  
  <p>Everything works fine but I need the real client IP in my Nginx access log, instead I get something like 10.0.1.37</p>
  
  <p>How get I can the real client ip?</p>
  
  <p>Thanks,</p>