Next.js Discord

Discord Forum

Next 13 layout, template, and page chunks are 404 hosted in NGINX

Answered
English Angora posted this in #help-forum
Open in Discord
English AngoraOP
Hello, for some reason just my layout template and page chunks are 404. Is something amiss? Why just the page template and layout chunks.
Answered by Golden-winged Warbler
It looks like you are rewriting paths you should not be, here is my nginx setup for next: https://github.com/hofstadter-io/hof/tree/_dev/next/ci/nginx
View full answer

7 Replies

Golden-winged Warbler
It looks like you are rewriting paths you should not be, here is my nginx setup for next: https://github.com/hofstadter-io/hof/tree/_dev/next/ci/nginx
Answer
English AngoraOP
I have an asset prefix for mine for statics so we don’t collide with the other containers but I’ll give this a shot thank you.
Golden-winged Warbler
yeah, your paths may be different, but I'd guess that a misalignment in the rewrites is the most likely cause. I made calls directly to the next container to figure out the correct path rewrites (which was none in my case)
you can also exec into the container and look around at the files there, iirc, I did more of that then making direct curls to next
English AngoraOP
@Golden-winged Warbler it worked lol thanks.
Golden-winged Warbler
that's great @English Angora! happy I could help
English AngoraOP
🙂 appreciate your time