Custom Domain is reaching out to the Primary Domain
davehowson
PROOP

2 years ago

I need to use my Nextjs App on a custom domain, which works using CNAME as mentioned in the guide.

But when I open the app on the custom domain (say.. mydomain.com), there are requests going from that to the primary domain - mydomain-production.up.railway.app

Also, all libraries and services, (eg. Sentry, Google OAuth) think that the up.railway.app domain is domain that I'm using, even when I visit the site using the custom domain

Solved

10 Replies

davehowson
PROOP

2 years ago

79565545-7fe2-4bd0-b982-558fdfa6b5e6


davehowson
PROOP

2 years ago

The issue here seems to be that the Nextjs server's address is the up.railway.app one.

So everytime the server has to call another service, the request originates from there and not from the custom domain.

This should not be the case. If my user accesses the app through the custom domain, then server should not refer the up.railway domain.


2 years ago

have you redeployed the service since adding the domain?


davehowson
PROOP

2 years ago

I have @Brody

Still no luck


2 years ago

you still have AUTH_URL set to the service domain


2 years ago

it should be set to "https://${{RAILWAY_PUBLIC_DOMAIN}}"


2 years ago

please use reference variables, not using a reference variable is what caused this issue


davehowson
PROOP

2 years ago

This worked. I've been trying to figure this out for hours. Thanks a lot @Brody. Really appreciate it.


2 years ago

no problem!


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...