x-forwarded-for and x-real-ip 127.0.0.1
ralyodio
HOBBYOP

2 months 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.

Solved

0 Replies

ralyodio
HOBBYOP

2 months ago

i think load balancer is not passing proper headers for real-ip


ralyodio
HOBBYOP

2 months 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 - 1596ms

ralyodio
HOBBYOP

2 months ago

i need to get user's ip address somehow


ralyodio
HOBBYOP

2 months ago

using Dockerfile to deploy



ralyodio
HOBBYOP

2 months ago

not working for me for some reason


brody
EMPLOYEE

2 months ago

That would be an issue with your application or configuration. I will let the community assist with that.


ralyodio
HOBBYOP

2 months ago

are you using docker?


brody
EMPLOYEE

2 months ago

Yes, though that is not applicable.


ralyodio
HOBBYOP

2 months ago

I'm u sing Docker -> nginx -> proxy (node app). and i always get 127.0.0.1


brody
EMPLOYEE

2 months ago

That would be an issue with your application or configuration.


brody
EMPLOYEE

2 months ago

x-forwarded-for and x-real-ip 127.0.0.1


ralyodio
HOBBYOP

2 months ago

ok


ralyodio
HOBBYOP

2 months ago

i see the issue


ralyodio
HOBBYOP

2 months ago

real-ip had two ips


ralyodio
HOBBYOP

2 months ago

x-forwarded-for "76.236.30.220, 100.64.0.3"


ralyodio
HOBBYOP

2 months ago

x-real-ip "100.64.0.3"

this must be the load balancer ip


medim
MODERATOR

2 months ago

The first IP here is the user's IP


medim
MODERATOR

2 months ago

The other IP's are the proxies it went through


ralyodio
HOBBYOP

2 months ago

ok


medim
MODERATOR

2 months ago

!s


Status changed to Solved medim 2 months ago


Loading...