502 error

vjceoHOBBY

9 months ago

I have created two services for my saas product. One for my front end and another for backend. Deployment is successfull, but when I try to launch the front end URL I see 502 in the browser console. I tried troubleshooting vite-config, .env, package.json, railway.json and environment variables, but not luck. I can share logs if required. Any thoughts ?

2 Replies

vjceoHOBBY

9 months ago

5104cef6-f495-4661-8070-a517d5ab0d86


9 months ago

you are likely running a development server.

copy the nixpacks.toml and caddyfile from this repo into yours.


onerafazTRIAL

8 months ago

I had the same issue deploying my frontend, if you check the logs, I was missing "--host" and it's working now.

"preview": "vite preview --host"

I never saw this mentioned anywhere in the help section.


8 months ago

Please do not run a development / preview server, that will cost you a lot and it is very unstable.

Please open a new thread so we can get you sorted with a production server.

Its not mentioned because it should never be done.