trying to setup wildcard domain with cloudflare
ramezj
HOBBYOP

5 months ago

Hello, I'm trying to setup a Wildcard Domain with cloudflare, I've added the DNS Records, I've changed the SSL Mode to Full. What could be wrong?

Solved$10 Bounty

Pinned Solution

5 months ago

For TLS certs, railway would automatically issue it for you, but since you are using cloudfare proxy, railway wont.

So either you can just update the DNS as "DNS only" and let railway issue a cert automatically for you

7 Replies

5 months ago

can you make sure that you added the records as it is provided by railway?

if you are trying to add www.website.com & website.com both, you should see Name something like below


ramezj
HOBBYOP

5 months ago

Ok. just did so, I have added CNAME, www that points to the same content of the normal domain, as seen in the screenshot.

Attachments


5 months ago

Hey @ramezj, adding the same content for two different CNAMEs is incorrect. Please delete any existing record of the website from cloudfare, and follow these steps -

You need to add two custom domains in railway -> 1. www.website.com and 2. website.com

Railway will give you two CNAME records for each of these (they will be of type CNAME, with different NAME and content value), and you need to add these two records in cloudfare individually (as shown in previous screenshot).

In DNS, these two are treated as different domains, and hence needs to be added separately.

Let me know if you run into any issues adding these.


ramezj
HOBBYOP

5 months ago

well I can't do that because I've hit the "domains limit"

for more context, I'm trying to setup wildcard domain because I'm working on a multi-tenancy project where I have to setup subdomains.


5 months ago

okay got it.

So you are adding two domains in railway - wegotwork.co & *.wegotwork.co

The later one will cover for all the wildcards. The only thing I see missing is incorrect setup in your cloudfare.

See while adding the domain1 (wegotwork.co), Railway would give you -

CNAME @

and domain2(*.wegotwork.co), Railway would give you two records-

CNAME _acme-challenge

CNAME *

Add these 3 records in your cloudfare as it is. I dont see the @ one in you DNS settings. And remove any unncessary records like CNAME www


5 months ago

For TLS certs, railway would automatically issue it for you, but since you are using cloudfare proxy, railway wont.

So either you can just update the DNS as "DNS only" and let railway issue a cert automatically for you


ramezj
HOBBYOP

5 months ago

i removed and re added *.wegotwork.co to railway, it gave me an extra TXT Record.

This setup worked fine. however, I don't really understand what was wrong.

Thank you so much!


Status changed to Solved brody 5 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...