404 Not Found when refreshing SPA React Vite app
Hi, guys.
I just deployed my Vite React app following the docs from the website (https://docs.dokploy.com/docs/core/vite-react). It worked fine but when i refresh or tried to access to a route of the SPA app it will throw 404 Not Found as shown in the image.
I know that i need to do a redirect but i'm not sure where exactly and what i need to put.
I'm using self-hosted Dokploy inside a VPS.
Welcome to Dokploy | Dokploy
Dokploy is a open source alternative to Heroku, Vercel, and Netlify.

2 Replies
Hi! I encountered this issue yesterday, and adding my own
nginx
config was necessary:
* You have to add a File mount (<your_project> -> Advanced -> Volumes -> Add volume -> File mount).
* The content can be the following:
* The File path should be: default.conf
* The Mount path should be: /etc/nginx/conf.d/default.conf
Note: I took the content from here.
I hope that it also solves your problem.it worked for me! Thank you very much