React routes not working on Droplets

Posted August 18, 2021 340 views
ReactDigitalOcean Droplets

I deployed my static web app follow this guide:

But routes not working, sub page can’t access.
ex: yourdomain/about or yourdomain/contact with error: 404 Not Found.

I found some similar topics but they do it with the App Platform not with Droplets

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer


I believe that you need to have your / location set to the following in order for the routes to work:

location / {
  try_files $uri /index.html;

If this still does not work, could you share your whole Nginx server block here?