R
Railway~/qudo

Setup Cloudflare Proxy

1. Clicked "custom domain". 2. Railway pops up a CNAME for me to add to Cloudflare. 3. Add CNAME record to Cloudflare. 4. Railway says "Cloudflare proxy detected" indicating it knows about the DNS change. 5. Test out domain and its dead, returns a 522. 6. Go back to Railway and test if generating a domain works. 7. It does. Generated domains work, so I know the app is serving correctly. Railway says it detects cloudflare DNS but Cloudflare is giving me 522s.
P
Percy44d ago
Project ID: N/A
B
Brody44d ago
can you send the custom and railway domain in question?
Q
~/qudo44d ago
I am trying this pattern with a few projects but here's one of he broken ones. Broken https://rulabs.dev/ Works rulabs-production.up.railway.app
Q
~/qudo44d ago
No description
B
Brody44d ago
what kind of app is that?
Q
~/qudo44d ago
Static site
Q
~/qudo44d ago
No description
Q
~/qudo44d ago
React app
B
Brody44d ago
create react app?
Q
~/qudo44d ago
No, was generated with NX, but its just a vite react app, static site in the end
Q
~/qudo44d ago
No description
No description
B
Brody44d ago
okay vite, cool. i suspect theres something going wrong with http-server, can we get you setup with a proper http server like caddy?
Q
~/qudo44d ago
ah, ok, i'll try that out then maybe i can use railway static here?
B
Brody44d ago
would you want to add me to your repo so i can figure out to integrate my pre-existing caddy solution? nope, it can not serve SPA apps
Q
~/qudo44d ago
yeah happy to, this is kinda a sandbox experiment so you can't break anything. i moved a few of our apps to this monorepo to test. see the package.json on how to build stuff. lmk your gh
B
Brody44d ago
brody192
Q
~/qudo44d ago
huh weird, some error about org seats. I made it public for a bit https://github.com/ru-labs/rulabs
GitHub
GitHub - ru-labs/rulabs
Contribute to ru-labs/rulabs development by creating an account on GitHub.
B
Brody44d ago
i assume you have build:the76devs and start:the76devs set in the service settings on railway?
Q
~/qudo44d ago
yep! previously i was trying with npx nx build the76devs but railway threw errors at that so i only made the package scripts to get past that
Q
~/qudo44d ago
which idk why, this other app i have from another repo works fine
No description
B
Brody44d ago
cool, ill see about doing a pr that will integrate caddy
Q
~/qudo44d ago
No description
Q
~/qudo44d ago
sweet thanks! and curious to see if there will be much extra to do when adding more apps in the future
B
Brody43d ago
ill try to make it as non intrusive as possible for the changes in the PR to work you just need to add a NIXPACKS_CONFIG_FILE service variable set to apps/the76devs/nixpacks.toml on the "the76devs" service, and the same variable set to apps/rulabs/nixpacks.toml on the "rulabs" service. as far as i can tell, everything else can stay the same. PR: https://github.com/ru-labs/rulabs/pull/1 test sites with cloudflare proxies: https://the76devs.railyard.link/ and https://rulabs.railyard.link/
Q
~/qudo43d ago
very cool! will play with this when home. Since all apps in this monorepo follow the same pattern I wonder if there's a way to share the same config every app will/should be built to dist/apps/appname but i can play with that. thanks again
B
Brody43d ago
no problem!
Q
~/qudo43d ago
just thought of something. i could probably use caddy to host a spa and make it ignore hashrouting huh 👀 sometimes i have those like small 2 route apps that would be just fine like that
B
Brody43d ago
why do you need to ignore hash routing?
Q
~/qudo43d ago
cleaner urls, can then do a URL + a hash while still only having client side app. There's some things with history you lose when using hash routes too i think. its a more rare case for sure. more so just wanted to try it out
B
Brody43d ago
why not do just regular page routing?
Q
~/qudo42d ago
your change worked! or was a part of the puzzle. after the change i was getting "too many redirects", and had to change my cloudflare ssl settings from "flexible" to "full".
Want results from more Discord servers?
Add your server
More Posts
Directus: impossible to update or to run the old versionProject ID : 9be34f5b-fa35-49c1-83c5-f0fbd245db9b Template : https://github.com/kadumedim/directus-sCSV files in storage/app/data/csv not accessible?Hello, I've setup a laravel api on railway. I have a seeder that tries to load csv files from the I have not touched my project in several weeks but at midnight railway reverted to a very old versioI'm very confused it looks like my project was deployed last night, although I have not touched it iI can't add DNS from GoDaddy to RailwayThey recommend me to change the server name...Unable to connect database after payentHello, i just pay for the month, now i'm unable to connect to the database. please help1,2GB RAM usage in React APPDo you know if it's normal this size of ram in a frontend created with react and typescript?Shopify proxy and HTTP/1.0Hello, I need help from members using Railway to host a Shopify app. I ran into this problem where Is it possible to change the default config of a Mysql Container?By default the container uses up a minimum of 500mb of ram, I found a stack overflow post on how to Cannot link, login nor logout with cli>railway logout 🚨 Response not successful status=404 >railway login 🚨 Response not successful staLost 2FA code for my accountI have lost my 2FA authenticator codes and I would like to reset my accountHow does it work the HD allocationI need 360gb to use how much does it cost?how to restore postgres db from dumb?i was given my db archives because my db was deleted due to migration. I am trying to restore the dbActivate SSL on my custom domainHello, I bought the domain apocolinks.com at DreamHost.com, this domain already has an active SSL ceBest way to secure postgres?What would be the best way to secure my postgres instance from outside connections? I would just turdeployments "Crashed"Hello, good afternoon, my problem is: deployments "Crashed" and the information in deploy logs MessaHow to use railway with monorepo?I created a new project and essentially my server code is not at the top level, and instead is one dHow can i set a limit?How can i set a limit per month?How can i pause my deployed MySQL Database before my trial plan ends?My project is named "amakusersdb".Cache mount ID is not prefixed with cache keyI'm getting the error above with this Dockerfile: ```dockerfile ARG NODE_VERSION=20.11.1 # Alpine Made a Paid account with Email and linking it with GitHub makes a separate trial accountHello Guys! I bought Railway Hobby plan three days ago and I'm trying to build my apps on Railway. B