X-Real-IP not working
fairdocument
FREEOP

6 months ago

I've been trying to implement X-Real-IP, but it's not being set. I've also tried X-Forwarded-For and X-Envoy-External-Address, though neither of them is passing a client IP. Anything else I should attempt?

Solved$10 Bounty

Pinned Solution

fra
HOBBYTop 10% Contributor

6 months ago

I"m able to get the ip using :

req.["X-Forwarded-For"] ?? req["X-Real-Ip"]

6 Replies

Railway
BOT

6 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


fairdocument
FREEOP

6 months ago

These are helpful, but unfortunately, the X-Real-IP isn't functioning as documented.


fra
HOBBYTop 10% Contributor

6 months ago

I"m able to get the ip using :

req.["X-Forwarded-For"] ?? req["X-Real-Ip"]

6 months ago

^^Could you confirm if fra solved your issues @fairdocument?


Status changed to Awaiting User Response Railway 6 months ago


fra
HOBBYTop 10% Contributor

6 months ago

you can also check this link:
https://utilities-metal-us-east-zfs.up.railway.app/raw

that (if I understood correctly) should show you the raw header passed by railway


Status changed to Awaiting Railway Response Railway 6 months ago


6 months ago

Unless there's something overwriting that header from the application level, fra's answer is correct. I'm accepting it as the answer.


Status changed to Awaiting User Response Railway 6 months ago


Status changed to Solved ray-chen 6 months ago


Loading...