Caddy with NextJS app running pages router.
Hi! I have been working on moving my current SaaS application from Cloud Run to Railway this week. I have an old version of the app (call this dashboard-old) which has pages and api routes, as well as a new NextJS app running (call this dashboard-v2) which I am trying to route traffic to with Caddy depending on the paths.
Old Dashboard Information:
- Spring Boot, caddy routes /* -> dashboard-old.railway.internal:PORT
- Currently does work.
V2 Information:
- NextJS app however traffic seems to get a 404 when trying to find _next files.
Is there any additional changes needed for NextJS?
4 Replies
Project ID:
4359f6f8-66c9-406b-92b1-bf8866d6426a
4359f6f8-66c9-406b-92b1-bf8866d6426a
I had the same problem but it got away in 2 minutes, problem was the deployment was marked as finished but actually build was finished and I could see nextjs was building pages under observability logs, once that was done it worked great
I ended up setting the output dir and it worked fine