nginx – 404 on refresh

When you have configured a vhost for your site it might happen that when you access your application using your host name for eg http://<host-name>/ it all works good. Also you would be able to browse through links with in your app. The problem comes when you are in a path  for eg http://<host-name>/some/path and you hit refresh you get a 404 error page. After a lot of digging finally found this on github issues. This extra line in the vhost could save your day.

location /{
                try_files $uri $uri/ /index.html?/$request_uri;

After adding do a nginx service restart and everything works great !