Skip to content

X-Real-IP and X-Forwarded-For are wrong with IPv6 clients #2349

@kedare

Description

@kedare

To Reproduce

  1. Create an application with mendhak/http-https-echo:31 (or anything really, this one is just an echo server) (you need to force port 8080 on the traefik backend conf)
  2. Go to the exposed application over an IPv6 address

Current vs. Expected behavior

I would expect the x-real-ip to contain my real IP and also it to be present in x-forwarded-for but I only see the local reverse proxy IP address

"x-forwarded-for": "172.18.0.1",
"x-real-ip": "172.18.0.1"

Provide environment information

Ubuntu 22.04 ARM64
Dokploy v0.24.5
VPS Provider: Oracle Cloud
Dual stack network

Which area(s) are affected? (Select all that apply)

Traefik

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

Issue confirmed on others apps in deploy (on my rails app for example even tho I trusted all RFC1918 proxies I still stop at a private IP instead of the real one).

I would gladly send a PR if I know where to look at in the code

Will you send a PR to fix it?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions