R
Railwayβ€’8mo ago
Adam

Invalid Host Header issue - React App

Hey all, having an issue with a react app hosted on Railway. It all works locally, but when accessing the url on Railway I get the error above. Any ideas? Logs are below
Solution:
https://github.com/brody192/create-react-app-starter copy the Caddyfile and nixpacks.toml from this repo into yours...
Jump to solution
20 Replies
Percy
Percyβ€’8mo ago
Project ID: N/A
Adam
Adamβ€’8mo ago
@Brody :)
Fragly
Fraglyβ€’8mo ago
No way
Brody
Brodyβ€’8mo ago
πŸ™‚
Adam
Adamβ€’8mo ago
I don't know react and am doing a project
Brody
Brodyβ€’8mo ago
react-scripts start starts a development server, lots of issues with that besides being a resource hog
Adam
Adamβ€’8mo ago
okay gotcha what should I use instead idc about resource hog this is temporary ╔════════ Nixpacks v1.19.0 ═══════╗ β•‘ setup β”‚ nodejs_18, npm-8_x β•‘ ║─────────────────────────────────║ β•‘ install β”‚ npm ci β•‘ ║─────────────────────────────────║ β•‘ build β”‚ npm run build β•‘ ║─────────────────────────────────║ β•‘ start β”‚ npm run start β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
Solution
Brody
Brodyβ€’8mo ago
https://github.com/brody192/create-react-app-starter copy the Caddyfile and nixpacks.toml from this repo into yours
Brody
Brodyβ€’8mo ago
(triple back ticks)
Adam
Adamβ€’8mo ago
ty
ty
Didn't work
Adam
Adamβ€’8mo ago
No description
Brody
Brodyβ€’8mo ago
new build logs please
Brody
Brodyβ€’8mo ago
looks good, theres no http requests there, so you are likely hitting the cache
Adam
Adamβ€’8mo ago
wait sorry I was looking at production preproduction looks like it's working! ty brody lifesaver
Brody
Brodyβ€’8mo ago
no problem!
Fragly
Fraglyβ€’8mo ago
Brody saves the day, again
Adam
Adamβ€’8mo ago
I will never learn js
Brody
Brodyβ€’8mo ago
based