#Deployment Issue – Caddy on Railway returning 404 for all routes

23 messages · Page 1 of 1 (latest)

frigid craterBOT
#

Project ID: 10fb3aa6-8aa3-401a-bf20-624a21c44ebe

obtuse fern
#

10fb3aa6-8aa3-401a-bf20-624a21c44ebe

#

@safe crystal sorry for the ping but its in some urgency mode

safe crystal
#

i'm sorry but we don't offer urgent support for non-platform related issues, i will come back to this thread when i have some spare time or a community member may pop in to help you before that

obtuse fern
#

I’m deploying a simple frontend (built with Vite) on Railway using the default Railpack (no custom Dockerfile). Everything seems to build and deploy correctly, but all routes (even /) are returning 404 in the logs:

frigid drift
#

can you share your caddyfile?

obtuse fern
#

I have not explicitly defined the caddy configurations its just what logs files are showing so TL;DR I have no caddy file

#

2025-05-06T15:01:01.264519938Z [INFO] handled request bytes_read=0 duration=0.000191314 logger="http.log.access.log0" request={"client_ip":"49.43.161.118","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"],"Accept-Encoding":["gzip, deflate, br, zstd"],"Accept-Language":["en-US,en;q=0.5"],"Priority":["u=0, i"],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["cross-site"],"Sec-Fetch-User":["?1"],"Te":["trailers"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:138.0) Gecko/20100101 Firefox/138.0"],"X-Forwarded-For":["49.43.161.118"],"X-Forwarded-Host":["king-maker.up.railway.app"],"X-Forwarded-Proto":["https"],"X-Railway-Edge":["railway/asia-southeast1-eqsg3a"],"X-Railway-Request-Id":["DlaFFj97Sp2acMU3U2VV7A_1774336823"],"X-Real-Ip":["49.43.161.118"],"X-Request-Start":["1746543658495"]},"host":"king-maker.up.railway.app","method":"GET","proto":"HTTP/1.1","remote_ip":"100.64.0.4","remote_port":"43344","uri":"/"} resp_headers={"Server":["Caddy"]} size=0 status=404 ts=1746543658.501624 user_id=""

These are the logs I am getting

safe crystal
#

just like to give you a friendly reminder that we do not offer urgent or any guarantee of a response within a specific time frame on the hobby plan, the conductors are volunteers, please be respectful of their time, and thank you for your patience.

obtuse fern
#

Hey Brody, totally understood — I really appreciate the work you and the other conductors do here. I didn’t mean to sound demanding earlier, just got a bit stuck and stressed. Thanks for the reminder, and I’ll be more mindful going forward 🙏

safe crystal
#

my message was in response to the gif as it can be seen as impatience

frigid drift
#

@obtuse fern is your vite building to the default dist folder?

obtuse fern
#

yes

frigid drift
obtuse fern
#

okay just a min let me take a look

frigid drift
#

You can overwrite it by creating your own Caddyfile at root

obtuse fern
#

okay let me try it

#

and update it here

#

this is caddyfile I am using now

global options

{
admin off
persist_config off
auto_https off

log {
    format json
}

servers {
    trusted_proxies static private_ranges 100.0.0.0/8
}

}

:{$PORT:80} {
log {
format json
}

respond /health 200

header {
    X-Content-Type-Options "nosniff"
    -Server
}

root * /usr/src/app/web/dist

file_server {
    hide .git
    hide .env*
}

encode {
    gzip
    zstd
}

try_files {path} {path}.html {path}/index.html /index.html

}

obtuse fern
#

its resolve now thanks to elon musk for his grok and medim

frigid drift
#

!s