Nginx reverse proxy with Railway public URL
raineking
PROOP

9 months ago

hey! i am using the nginx proxy manager template https://railway.com/new/template/vXq1Wp to add a reverse proxy infront of my nextjs app to restrict access to my endpoints.

we've been using the public railway url (up.railway.app) to access the webapp and was wondering if it's possible to use that url as the domain name in the proxy host or if i need to get a custom domain - i haven't been able to get it to work with the public (up.railway.app) url

Solved$10 Bounty

23 Replies

raineking
PROOP

9 months ago

f0eed4f7-b320-494d-82ed-895da4afb9be


raineking
PROOP

9 months ago

looks like the answer was removed here. was there something wrong with the answer or was it removed by accident?


9 months ago

It looked like an AI generated answer to me.


raineking
PROOP

9 months ago

ah gotcha


raineking
PROOP

9 months ago

but regarding above -- i can't use the public railway url (up.railway.app) for the domain name in the proxy host and would need to use a custom domain right?


9 months ago

I'm sorry, I'm not familiar with the NGINX proxy manager, I will need to let the community step in to help you here.


9 months ago

hey, Railway domains should work just fine with any reverse proxy


raineking
PROOP

9 months ago

would i put the public railway url under "Domain Names" and put the internal private networking url under forward hostname/IP?

1385470405879402500


raineking
PROOP

9 months ago

i tried that but it didn't work - would i need to remove the public url from my app's container?


9 months ago

Yep your public domain needs to be attached to the Nginx service.


9 months ago

afaik you can remove the domain from your webapp and then add it again to the Nginx one


9 months ago

like when you generate a domain, you can edit the generated domain so just edit it to be the same as your webapp domain


9 months ago

unfortunately a downtime will be required for that.


raineking
PROOP

9 months ago

when you say "same as your webapp domain" do you mean the custom domain for my webapp?


raineking
PROOP

9 months ago

cause i don't have one i've just been using the railway up.railway.app to access my webapp


9 months ago

the up.railway.app can be modified to be anything you want

1385471807477514200


9 months ago

the flow would be

1 - remove the railway domain from your webapp service
2 - add a domain to your Nginx service and edit it to match the one your web application previously used


raineking
PROOP

9 months ago

got it!


raineking
PROOP

9 months ago

and just to make sure when you say "add a domain to your Nginx service" are you talking about adding it to the nginx-proxy-manager container within railway or the nginx dashboard where i add the actual proxy host


9 months ago

add it within Railway


9 months ago

actually you'll need to add on both


raineking
PROOP

9 months ago

okay great i'll try that


raineking
PROOP

9 months ago

thanks!


Status changed to Solved chandrika 9 months ago


Loading...