R
Railway12mo ago
yrnsmth

React/Vite/Caddy re-routing is failing

Hi all, I've copy/pasted Brodie's nixpacks.tom & caddyfile to my react/vite project, and yesterday it was working fine. Overnight, the re-routing not-found domains has stopped working. I have a custom domain set up, and it works if I go straight to that domain on desktop (but not mobile?): bandbudgie.com Redirects to sign-in page (bandbudgie.com/sign-in) (as it should) If I refresh this on bandbudgie.com/sign-in I get a "This site can't be reached" error... The custom domain settings are set up on my DNS, and railway seems to think they are connected up properly... What's frustrating is that this was working okay last night, until I started messing around with some SMTP properties on the DNS end (though I left the railway CNAME record alone). Am I missing something? Was I not supposed to remove the Generated URL? A separate (but maybe related?) issue - my vite environment variables don't seem to be updating when I update my variables - that is, my RAILWAY_PUBLIC_DOMAIN updates within the Railway variables screen... but the value of import.meta.env.VITE_BASE_URL that is rendering in React isn't updating... Is this something to do with nixpack caching? ProjectId: 1e4b0651-0174-42a1-aac8-4081f16bb807
No description
No description
No description
5 Replies
Percy
Percy12mo ago
Project ID: 1e4b0651-0174-42a1-aac8-4081f16bb807
yrnsmth
yrnsmthOP12mo ago
EDIT: this is the line I'm referring to as "re-routing not-found domains has stopped working"... Cadyfile:35
No description
Brody
Brody12mo ago
everything works fine for me, open the page on desktop and mobile and I get redirected to the sign in page and I can refresh without issues this is in place to send all incoming requests to index.html as you have a single page app, I recommend reading up on what a single page app means
yrnsmth
yrnsmthOP12mo ago
Oh - I realise what that is. I've set up the equivalent in Netlify before, too. I couldn't work out why it was breaking for me, though - and thought there might be a caching issue. But you're right, everything is working again.
Brody
Brody12mo ago
caching, stale dns, a bunch of things but happy to hear its working again!
Want results from more Discord servers?
Add your server