reactjs – Home page redirection problem with a SPA under Next.js and Nginx

I’m experiencing a problem with my website, a Single Page Application (SPA) developed with Next.js and deployed behind Nginx. Here’s the problem in detail:

I can navigate between all the pages of the site without any problem via the internal links.
But when I reload a specific page or try to access a specific URL directly (e.g. /about or /contact), the site automatically redirects to the home page (/), instead of loading the requested page.
This problem does not occur in local environments. It only occurs in remote development or production environments.
I’ve tried to solve the problem by modifying nginx in all directions, but the problem doesn’t seem to come from there. Do you have any ideas?

I’ve tried to solve the problem by modifying nginx in all directions, but the problem doesn’t seem to come from there. Do you have any ideas?

Read more here: Source link