a year ago
The issue is that Railway's load balancer is not properly forwarding the real client IP. The problem is that Railway is setting x-forwarded-for and x-real-ip to 127.0.0.1, which means Railway's load balancer is not configured to pass through the real client IP.
21 Replies
a year ago
i think load balancer is not passing proper headers for real-ip
a year ago
[IP-DEBUG] Direct connection: 127.0.0.1
š [IP-DEBUG] Found proxy headers: { xff: '127.0.0.1', real: '127.0.0.1' }
ā
[IP-DEBUG] Using x-real-ip: 127.0.0.1
š [HTTP-REQUEST] GET / - IP: 127.0.0.1 - UA: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
š” [PROXY-HEADERS] { 'x-forwarded-for': '127.0.0.1', 'x-real-ip': '127.0.0.1' }
ā
[HTTP-RESPONSE] GET / - 200 - 1596msa year ago
i need to get user's ip address somehow
a year ago
using Dockerfile to deploy
a year ago
Looks to be working fine:
a year ago
not working for me for some reason
a year ago
That would be an issue with your application or configuration. I will let the community assist with that.
a year ago
are you using docker?
a year ago
Yes, though that is not applicable.
a year ago
I'm u sing Docker -> nginx -> proxy (node app). and i always get 127.0.0.1
a year ago
That would be an issue with your application or configuration.
a year ago
x-forwarded-for and x-real-ip 127.0.0.1
a year ago
ok
a year ago
i see the issue
a year ago
real-ip had two ips
a year ago
x-forwarded-for "76.236.30.220, 100.64.0.3"
a year ago
x-real-ip "100.64.0.3"
this must be the load balancer ip
a year ago
The first IP here is the user's IP
a year ago
The other IP's are the proxies it went through
a year ago
ok
a year ago
!s
Status changed to Solved medim ⢠about 1 year ago