8 months ago
The deployment is successful, however, when I try to access my app in a browser, I get a 502. I've verified the port in railway settings matches the port in Caddyfile
33 Replies
8 months ago
Can you access it through the Railway generated domain?
8 months ago
I wonder if it's related to your cloudflare setup
8 months ago
Can you try following the mentioned docs on Fixing Common Errors linked on that error page?
8 months ago
A 502 usually means your Caddy server isn’t actually serving the app on the port Railway is expecting, even if it looks like the port matches.
Make sure your Vite build is serving the production files and not just running the dev server. The Vite dev server isn’t meant for production and will cause this kind of issue.
Also double check your Caddyfile to make sure it’s pointing to the correct build folder and that Caddy is properly serving on 0.0.0.0, not just localhost.
If you’re still stuck, try testing without Caddy first to see if the app can run directly, then add Caddy back in once it works.
I checked the port and that seems to match.. I'm not sure what else to try from there
I was running into this issue as well. Please check out my thread https://discord.com/channels/713503345364697088/1386788139649073223 and see if it helps
I don't see anything in my log files that compares to the log files in your thread..
```Starting Container
maxprocs: Updating GOMAXPROCS=8: determined from CPU quota
GOMEMLIMIT is updated
using config from file
adapted config to JSON
admin endpoint disabled
automatic HTTPS is completely disabled for server
started background certificate maintenance
HTTP/2 skipped because it requires TLS
HTTP/3 skipped because it requires TLS
server running
serving initial configuration
cleaning storage unit
finished cleaning storage units```
The answer that I'm still waiting to try out is to not have a Dockerfile or a Caddyfile and don't have a "start" script in my package.json
If anyone can help, let me know. The repo I'm trying to get running is https://github.com/mercurjs/vendor-panel
8 months ago
This repo doesn't has a Dockerfile like you described earlier.
8 months ago
Are you using your own Dockerfile?
I was trying to get it to work with a Dockerfile, but I've since removed it
8 months ago
I will try to deploy it, one sec
8 months ago
for context: https://discord.com/channels/713503345364697088/1385062839563194368
seems like it's impossible to make it work with Railpack as that project runs with Yarn@3
I didn't went too far with Nixpacks tho
I finally got this working tonite so it looks like I may stay with Railway
8 months ago
What was the solution?
I installed caddy(not 100% sure if this was necessary), made "vite build" my build script, removed start script, removed Dockerfile and set port to 8080 (caddy default?)
8 months ago
!s
Status changed to Solved brody • 8 months ago

