Building an AngularJS app and want to use HTML5 mode with NGINX. Did a rewrite to direct all traffic to index.html. Problem I'm running into is all my assets (images, template files for angular, etc). Those are getting written back to index.html as well so it breaks the app. Any ideas on what the nginx config should look like. I'm not seeing anything that handles assets when I search.
location / {
try_files $uri $uri/ /index.html;
}
It sounds like your server root is not properly defined. The location rule you specified tries the $uri before defaulting to index.html. Therefore if the file (css, js, jpg) exists in the configured root location, it will be served before index.html is called.
This is a really dirty solution, so it's only for a temporary solution, i hope when migrate to Angular 1.4 this will not necesary
test it