16 days ago
I have a question: does your domain system accept my CNAME system? For example, I have a multi-tenant system, and I need it to work with multiple domains, and my customers can point the domain to the platform. Is this possible? Currently, I release cname.domain.tld to my customers, and they point CNAME to their domains.
163 Replies
16 days ago
My system is a store for game servers, similar to tebex.
16 days ago
When I point to a custom domain, I get an error.

16 days ago
This error occurs when I try to access the custom domain that is pointed to in the CNAME.

16 days ago
Did you make sure the proxied port is the port your application is listening to?
15 days ago
Hi man,
I am currently working on a similar style app and what I am doing is the following.
1. Setup a wildcard domain on railway so you can have customer.pingalways.com
Setup cloudflare for saas on your
pingalways.comdomainDo all routing/rewriting through cloudflare.
15 days ago
Hey, Railway has support for wildcard domains. Here's the full documentation on how to set it up: https://docs.railway.com/guides/public-networking#wildcard-domains.
I would recommend removing any custom domains (even DNS records) you've added and trying again from scratch by following the documentation above.
If you hit any roadblocks, let us know!
passos
Hey, Railway has support for wildcard domains. Here's the full documentation on how to set it up: https://docs.railway.com/guides/public-networking#wildcard-domains.I would recommend removing any custom domains (even DNS records) you've added and trying again from scratch by following the documentation above.If you hit any roadblocks, let us know!
13 days ago
I'll take a look to do it that way.
dtknepper
Hi man,I am currently working on a similar style app and what I am doing is the following.1. Setup a wildcard domain on railway so you can have customer.pingalways.comSetup cloudflare for saas on your pingalways.com domainDo all routing/rewriting through cloudflare.
13 days ago
I'll try that way too.
13 days ago
From what I've seen in the documentation, do I need to register each of my clients' domains in your dashboard?
13 days ago
My current setup, railway and Cloudflare (DNS and CF for SaaS). Is there anything wrong with it?



13 days ago
I am getting the error “Invalid SSL certificate” when pointing to the domain hyren.luccabassoli.com (example domain for a customer's store). This domain is pointed to cname.hyren.net and configured in Cloudflare for SaaS, which I use their API to register.

12 days ago
@Chandrika can you helpme?
12 days ago
Please don't ping team members! #🛂|readme 5)
12 days ago
11 days ago
Hi?
11 days ago
Hi?
10 days ago
Hey @Lucca Bassoli, I'm trying to understand your case. Do you have multiple client domains that you want Railway to support? Are these domains dynamic rather than static?
10 days ago
||sorry for accidental ping ludwig||
10 days ago
If that's a yes, then I'm afraid your case isn't supported. Railway currently only supports a set of known domains. I'm guessing that your use case is some kind of shop that users can create and is known by their own custom domain.
10 days ago
I have a system where my system's client can point their domain through cname. I release a cname (cname.hyren.net) and it points to domain.tld, but when it points, it does not show the website and gives an SSL error. Do I need to register the client's domain in the railway domains?
10 days ago
Yes, you're required to register your client's domain in Railway.
10 days ago
Is there a limit? Can I change my limits? Because I would need to run more than 100 stores.
10 days ago
Yes, the Pro Plan is limited to 20 domains per service. The Railway Team might increase this limit upon request.
10 days ago
9 days ago
I saw that thread, but it seems they didn't get anywhere.
9 days ago
So it seems to me that this is not possible to do on the Railroad.
9 days ago
On Railway no, on Cloudflare, yes.
9 days ago
Okay, but I use Cloudflare for SaaS. How can I point to the application? How do I do that in Cloudflare?
9 days ago
I'm sorry but we cannot provide support for 3rd party services, I'll let the community assist with that.
9 days ago
I'm unfamiliar with Cloudflare SaaS, but I'm testing how it would work on your specific setup, give me a minute.
9 days ago
I've managed to figure it out, but be aware, it's quite complicated to follow.
Since Cloudflare only allows
Hostheader rewrites on Enterprise plans, we'll not be able to use Railway's proxy so deploy an Nginx instance on Railway and expose it via TCP proxy to access its port directly.Configure Cloudflare SaaS. When defining your fallback origin (where traffic routes), specify your TCP proxy's domain without the port number as a CNAME.
Create an origin rule in Cloudflare to route all incoming traffic to Railway's TCP proxy port.
Under Cloudflare's SSL/TLS settings, enable
Flexibleencryption mode to allow the HTTP traffic.
If you really want to proceed with it, let me know and I can guide you through their dashboard using screenshots. However, I completely understand if you choose not to, as unfortunately, I don't think Railway is the best option for you in this situation.
Maybe the team can increase your domain limits, after which you'll be able to complete the task either manually or via API until Railway develops a more effective solution for this issue.
9 days ago
You can do it with snippets -
9 days ago
Only available on Pro Plans and above. I won't be able to help here on how to set up the snippets as I don't have the Pro Plan. But in theory, it should be a simple script to rewrite the Host header to be yours and then include an extra header to identify which domain it is.
8 days ago
Humm
8 days ago
I am interested in continuing, as Ralway is a good place to deploy and I already have several applications with them. If you could help me with step-by-step instructions on printing 🙂 That would even help the community.
8 days ago
Cloudflare Snippets is only available on the Pro plan. I am currently on Cloudflare's free plan. I only pay for their SaaS.
8 days ago
I think if you are running a business and you use Cloudflare it would be reasonable to be on their Pro plan?
7 days ago
If I can do it for free, there's no reason to pay for it. I don't have that many customers. I only use their routing for SaaS and some blocking rules. But I intend to pay for it. I just don't see much reason to do so yet.
7 days ago
Great, just give me sometime to get off work (might take awhile), i'll mention you here.
7 days ago
Okay, thanks for your help. I look forward to hearing from you!
7 days ago
Hey, are you available now?
6 days ago
Hi
6 days ago
I wasn't home at that time, but if you want, you can send it and I'll take a look. I don't think we'll be able to synchronize due to the time zones, haha.
6 days ago
@Lucca Bassoli Are you able to follow it? If you have any questions, just send them here. I'll be active.
6 days ago
How do I upgrade nginx? The Railway template I saw here doesn't save the data correctly.
6 days ago
Can you send me your DNS record settings? Mine already has flexible SSL.
6 days ago
Sorry for delay, I would recommend using the Nginx Proxy Manager as it offers a nice UI to manage it
6 days ago

5 days ago
I installed that one, but it isn't saving the data. It seems that when it restarts, it loses the credentials and settings. How did you solve that?
5 days ago
Mine is like that too.
5 days ago
I reinstalled nginx proxy manager. How are your settings in it?
5 days ago
It isn't? will confirm
5 days ago
Instead of Nginx Proxy Manager, use something else
5 days ago
Instead of Nginx Proxy Manager, use the Caddy template.
Deploy the template
Click on the service created, go to settings and then eject, follow instructions to eject
On the repository created by Railway, modify the Caddyfile to be something like this:
:{$PORT} {
reverse_proxy :
}5 days ago
What is the caddy template? I don't understand.
5 days ago
This template? https://railway.com/deploy/7uDSyj
5 days ago
This one https://railway.com/deploy/TETV8z
5 days ago
Try that first and then I'll get you a better config that handles service replicas and more
5 days ago
Ok
5 days ago
It seems to me that what I sent is the same, isn't it?
5 days ago
Change made
5 days ago

5 days ago
remove everything else
5 days ago
just keep the lines from 1-3
5 days ago
Removed
5 days ago

5 days ago
Now should I point the CNAME to this service?
5 days ago
Great, did you already enable Cloudflare SaaS?
5 days ago
Yes
5 days ago
Now, you'll add a TCP proxy to your Caddy application
5 days ago

5 days ago
This?

5 days ago
Yep, first add the PORT environment variable to your service, PORT=8080 is define
5 days ago
A gente está falando em ingles e agora vi que vc é br 😐
5 days ago
On here, each customer you add will need to be added there, you can remove your CNAME
5 days ago
Ok
5 days ago
Yeah, but Railway wants to keep every message in here in English. It keeps things more organized.
5 days ago
Ok
5 days ago
The custom host name cname.hyren.net has been deleted.
5 days ago

5 days ago
Which door should I put here?
5 days ago
Set 8080
5 days ago
Done
5 days ago
Railway will give you a combination of domain:port, create a CNAME pointing to the domain only
5 days ago
Ok
5 days ago
Done
5 days ago
Now, add that CNAME as a fallback origin
5 days ago
No, sorry
5 days ago
give me a minute
5 days ago
Ok
5 days ago
After you've added that CNAME, create another one that points to that one
So if you've created [proxy-fallback.hyren.net](proxy-fallback.hyren.net) thats points to Railway for example, create another CNAME that points to that, for example [customers.hyren.net](customers.hyren.net) points to [proxy-fallback.hyren.net](proxy-fallback.hyren.net)
5 days ago
And then add the [proxy-fallback.hyren.net](proxy-fallback.hyren.net) into Cloudflare SaaS as a fallback origin
5 days ago
Like this?



5 days ago
Oops, cname.hyren.net is missing go to proxy-fallback.hyren.net.
5 days ago
Done

5 days ago
No, on Railway remove the custom domain
5 days ago
you should get the combination below it shuttle.<…>
5 days ago
And then create a CNAME to it
5 days ago
That way?

5 days ago
Great, just fix this
5 days ago
Fixed
5 days ago

5 days ago
Now we'll create a page rule to redirect all traffic to that Railway port
5 days ago
Can you find where we can create that? I don't have the URL unfortunately
5 days ago
It should be in the sidebar, named as "rules" or "origin rules"
5 days ago
Yes
5 days ago
I am on the page.
5 days ago

5 days ago

5 days ago
No, it's another one
5 days ago
Should be in the same category in the sidebar
5 days ago

5 days ago
Try "Visão geral"
5 days ago

5 days ago

5 days ago
Click on "Nova Regra"
5 days ago

5 days ago
Sorry, go to "Modelos" and then navigate to the last page, where you should find a "Change Port" template.
5 days ago
For me, that option is not available.
5 days ago
It does not appear on the list.
5 days ago
It's the last page, first item

5 days ago
Can you click on it and send me the link it redirected you to? I'll change the parameters according to my account.
5 days ago
5 days ago
Good!
5 days ago
It worked haha, I'm here.
5 days ago

5 days ago
Great, now on Rewrite to set 23113 (the same as Railway), also make sure to set the following Custom Filter Expression

5 days ago
Done
5 days ago

5 days ago

5 days ago
That should've been the last step but I'm unable to connect to your Caddy service, are you sure it's up? http://shuttle.proxy.rlwy.net:23113/
5 days ago
Yes, but it seems that it is not on the correct port where the TCP proxy was generated. From what I can see in the logs, it is running on another port.
5 days ago
2019 or 80?

5 days ago

5 days ago
Definitely weird, you added the PORT environment variable, right?
5 days ago
If not, maybe try 2019 on Railway
5 days ago
True, I hadn't seen the email. It's running at 80.
5 days ago
working now
5 days ago
I'm seeing it's working https://hyren.luccabassoli.com/ 👀
5 days ago
One question: do I need to register cname.hyren.net in the application?
5 days ago
In the application, it is as follows

5 days ago
No, [cname.hyren.net](cname.hyren.net) is not used.
5 days ago
Ok
5 days ago
Every customer that you add simply needs to be added on Cloudflare
5 days ago
If you want to automate that, Cloudflare has APIs for that.
5 days ago
I can no longer access the main domain. Do I need to point it to the CNAME?
5 days ago
Maybe it's related to the SSL/TLS flexible option as Cloudflare is now sending HTTP traffic instead of HTTPS
5 days ago
ERRTOOMANY_REDIRECTS is occurring
5 days ago
What you can do is turn on the Full option.
5 days ago
And then change your Caddy config to generate a self signed certificate
Something like this should do the trick:
{
acme_ca internal
}
:${PORT} {
tls internal
reverse_proxy :
}5 days ago
To be sure, turn on the Full option first and see if it recovers the main domain
5 days ago
I activated Full, the main domain came back, but the one using cname stopped working.
5 days ago
yeah, then follow my instructions here
5 days ago
Ok
5 days ago
Error: adapting config using caddyfile: parsing key: invalid port '${PORT}': strconv.Atoi: parsing "${PORT}": invalid syntax5 days ago
change :${PORT} to :{$PORT}
5 days ago
A new error occurred
Error: adapting config using caddyfile: automation policy from site block is also default/catch-all policy because of key without hostname, and the two are in conflict: []certmagic.Issuer(nil) != []certmagic.Issuer{(*caddytls.InternalIssuer)(0xc0002d3560)}5 days ago
Resolved
5 days ago
:{$PORT} {
tls internal
reverse_proxy hyren-web.railway.internal:8080
}5 days ago
Great, any more issues that you're having?
5 days ago
None, thank you very much for your help! 🤝 🇧🇷
5 days ago
Status changed to Solved passos • 5 days ago