#Nginx reverse proxy with Railway public URL

24 messages · Page 1 of 1 (latest)

errant shore
#

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

drifting violetBOT
#

Project ID: f0eed4f7-b320-494d-82ed-895da4afb9be

errant shore
#

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

errant shore
#

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

north python
#

It looked like an AI generated answer to me.

errant shore
#

ah gotcha

#

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?

north python
#

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.

fossil vortex
errant shore
#

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

#

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

fossil vortex
#

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

#

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

fossil vortex
#

unfortunately a downtime will be required for that.

errant shore
#

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

#

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

fossil vortex
#

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

#

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

errant shore
#

got it!

#

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

fossil vortex
#

add it within Railway

#

actually you'll need to add on both

errant shore
#

okay great i'll try that