502 error
vjceo
HOBBYOP

a year 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 ?

4 Replies

vjceo
HOBBYOP

a year ago

5104cef6-f495-4661-8070-a517d5ab0d86


a year ago

you are likely running a development server.

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


onerafaz
TRIAL

a year 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.


a year 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.


Loading...