X-Forwarded-Port

Hello,
I'm trying to host a php app on Railway but I got a problem with the rlwy Public Domains. My app is running on port 80 and requires the following headers to be present :

  • X-Forwarded-Host

  • X-Forwarded-Port

  • X-Forwarded-Pro(col)

I saw that Railway doesn't provide the X-Forwarded-Port header to the backend. Is there any workaround I could use to make my app works on railway ?
I don't want to edit the source code of the app if possible.
Thank you

Solved

9 Replies

8ab8390f-8ffe-4eda-a641-5edd38082e42


I'm using php:8.2-apache Docker Image


8ab8390f-8ffe-4eda-a641-5edd38082e42


X-Forwarded-Port


As a workaround I made Apache listen on port 443 (still on HTTP) but I don't think it's a very good practice so if there is another solution I would be happy to try it 🙂


a year ago

X-Forwarded-Port is always going to be 443, so you can hardcode that without issues


That's exactly what I ended up doing I don't know why it didn't came to my mind the first time 😭


a year ago

awesome!


a year ago

!s


Status changed to Solved brody 11 months ago


Loading...