22 days ago
Hi everyone,
I’m working on automating infrastructure setup across multiple instances and I’m trying to figure out the best way to handle wildcard domains programmatically on Railway.
Goal:
I want every instance/service I spin up to automatically be accessible via a wildcard subdomain, something like:
*.mydomain.comSo instead of manually assigning domains for each deployment, new instances would automatically resolve under a consistent wildcard pattern (for example: instance1.mydomain.com, instance2.mydomain.com, etc.).
1 Replies
22 days ago
Add *.mydomain.com as a custom domain on your service so that all subdomains will route there and your app handles routing .If you need to assign some subdomains to different services programmatically, you can use railway's GraphQL API (customDomainCreate mutation).