Remote users IPV6 address shows as localhost


#1

When a user is signed into the forum under an IPV6 address their IP shows up as 127.0.0.1 in the administrator panel.

This is using the latest version.


Why does all my users have 127.0.0.1 seen last Ip addres
(Sam Saffron) #2

How is your network configured, is there an NGINX in front of your container?


#3

I’m not really sure. I just installed discourse to check it out using the basic tutorial: here – saw everything was fine then added a ipv6 address to my ovh machine and saw that all worked fine (disabling IPV4 on my computer to be sure) logging in and checking what my own IP showed returned that local IP. (signing in with ipv4 shows my ipv4 address just fine).

perhaps I messed something up?


(Sumpfling) #4

Nope, you probably didn’t mess anything up.

We have the same problem with our discourse instance. (Installation on a Ubuntu host, “default” docker image etc. pp.).

We DO NOT have nginx in front of our container (i.e. on the docker-host)
So its basically
I-Net ---- Port-Firewall (assume: no NAT, routing done) ---- Docker-Host

If a client-request comes in via IPv4 (with an IPv4 source address) I see the correct address in the “discourse-logs”/UI
If a client-request comes in via IPv6 (with an IPv6 source address) the UI shows 127.0.0.1

I suspect that it has something to do with the docker container not having an IPv6-address and not having nginx or a reverse-proxy before the container that could “grab” the IPv6-Address and put it into X-Forwarded-For

No solution from my side so far - I tried to enable IPv6 for my docker but failed to assign a fixed IPv6-IP to the discourse-container …