I use Nginx to serve SPA (single page application) to support the HTML5 history API. I need to rewrite ever deeper routes back to /index.html , so I follow this article and it works! Here is what I have now added to nginx.conf:
server { listen 80 default; server_name my.domain.com; root /path/to/app/root; rewrite ^(.+)$ /index.html last; }
However, there is one problem: I have a /assets directory under the root containing all css, js, images, fonts stuffs, I donβt want to rewrite these URLs, I just want to ignore these assets, how do I suppose to be done?
source share