Skip to content
X-Forwarded-Port

2 years ago

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

2 years ago

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


2 years ago

I'm using php:8.2-apache Docker Image


2 years ago

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


2 years ago

X-Forwarded-Port


2 years ago

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 🙂


2 years ago

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


2 years ago

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


2 years ago

awesome!


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...