Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make traefik keep source IPs in Swarm mode #291

Open
Kexkey opened this issue Dec 8, 2022 · 0 comments
Open

Make traefik keep source IPs in Swarm mode #291

Kexkey opened this issue Dec 8, 2022 · 0 comments

Comments

@Kexkey
Copy link
Collaborator

Kexkey commented Dec 8, 2022

In Swarm mode, a container that receives a request will not get the real source IP but the internal Docker swarm proxy's IP. This can be a problem when a service needs the real IP, obviously.

Traefik receives outside requests for the installed cypherapps and some of those apps need the source IP often for logging purposes. Same goes for the gatekeeper when it is exposed outside of the Docker network and receives requests from CN clients.

Possible solution: make traefik listen directly to host ports (80/443) instead of ingress network, it will then forward the IP in X-Real-Ip header. Something like this for traefik deployment:

ports:
      - target: 80
        published: 80
        protocol: tcp
        mode: host
      - target: 443
        published: 443
        protocol: tcp
        mode: host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant