404 Not Found with React Router and Nginx
Dec 10, 2022
To fix this issue on linux, we need edit nginx config file.
have used linux terminal nano editor.
nano /etc/nginx/sites-available/default
Basically, We need fix redirection of location from 404 to index.html in case route not found, so that our single page application will take care of routing.
Save file with ctrl+o. Exit editor with ctrl+x .
We need reload nginx config with below command.
nginx -s reload
Go to url with routes and try refresh. it should not result to 404.
Peace.