I'm in the process of making SPA web application using Svelte and SvelteKit. I'm using node adapter and so far everything was fine, I prepared one test environment (running application with pm2 and nginx proxy) besides running the application locally. I started facing problem with the preparation of new environment, if I request any application route I'm getting back response with 404 status and index page content. If I request any static resource it returns successful 200 response. Application is working just fine on the same server (meaning it's not about node version or any other software package versions) if I run it in dev mode (npm start), but if I build it (npm run build) and then run it (node build) this defect is there.
I tried requesting different application routes with and without trailing slash, it seems it's not about that, it seems like framework is not figuring out any of the application routes. I started looking into code generated by build process to try to figure out what might be the problem, but it's a bit overwhelming.