X-Real-IP not working
fairdocument
FREEOP

9 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
HOBBY

9 months ago

I"m able to get the ip using :

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

6 Replies

Railway
BOT

9 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

9 months ago

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


fra
HOBBY

9 months ago

I"m able to get the ip using :

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

9 months ago

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


Status changed to Awaiting User Response Railway 10 months ago


fra
HOBBY

9 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 10 months ago


9 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 10 months ago


Status changed to Solved ray-chen 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...