I'm having some issues with preview. When working locally, it works flawless, but I get a 404(my 404 page) in production, and the page reloads continuously.
I checked the application and the preview cookie is there but I noticed that in the build folder, there is no "api" directory with preview.js and exit-preview.js.
This sounds like an issue with deploying Next.js api routes using NGINX and docker. There's a similar issue when using Netlify to deploy Next.js projects.
This is why it's recommended to deploy Next.js apps with Vercel, because as they state when deploying with Vercel: