I use Nginx to serve a SPA (Single Page Application), in order to support HTML5 History API I have to rewrite all deeper routes back to the /index.html
, so I follow this article and it works! This is what I put in nginx.conf now:
server {
listen 80 default;
server_name my.domain.com;
root /path/to/app/root;
rewrite ^(.+)$ /index.html last;
}
However there's one problem, I have an /assets
directory under the root contains all the css, js, images, fonts stuffs, I don't want to rewrite these urls, I just want to ignore these assets, how am I suppose to do?