Custom Domain is reaching out to the Primary Domain
davehowson
PROOP

a year 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

a year ago

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


davehowson
PROOP

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


a year ago

have you redeployed the service since adding the domain?


davehowson
PROOP

a year ago

I have @Brody

Still no luck


a year ago

you still have AUTH_URL set to the service domain


a year ago

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


a year ago

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


davehowson
PROOP

a year ago

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


a year ago

no problem!


a year ago

!s


Status changed to Solved brody over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...