-
-
Notifications
You must be signed in to change notification settings - Fork 678
x-forwarded-for HTTP header not (always) being honored #3286
Comments
Did you configure Dendrite to use the header? Lines 284 to 289 in d65449c
|
Indeed, I did not 😉 Thank you for your awesomely quick response. Setting But, if I may, do you think Dendrite should perhaps auto-try any of the standard "this is the client's real IP" headers automatically? Do you see any downsides in doing that? For what it's worth, from my limited self-hosting experience, many applications do it automatically, given the current trends in hosting stuff (everything behind reverse proxy or ingress or whatever) Best regards |
Maybe worth a try and shouldn't be to difficult to add. |
Closing this, glad it works now! |
Background information
Description
I am running official Docker container image for the latest Dendrite 0.3.15 version in Docker Swarm cluster behind HAproxy. HAproxy is configured to properly set 'x-forwarded-for' (all-lowercase) HTTP header to indicate request's originator's true IP address. Due to peculiarities of how Docker stack works in Swarm mode (containers behind routing mesh and ingress) and also the whole thing being behind reverse proxy, TCP connections received by Dendrite appear to originate from local Docker cluster pool like 10.0.0.x. Due to all that, the 'x-forwarded-for' header, if present, should be relied upon for resolving client's IP. But Dendrite seems to be failing to do so at least in how it establishes user's session IPs as evidenced by the screenshot from Element.
Steps to reproduce
The text was updated successfully, but these errors were encountered: