I\'m serving Angular 2 application with nginx using location section this way:
location / { try_files $uri $uri/ /index.html =404; }
try_file
Found a solution using nginx named locations:
location / { gzip_static on; try_files $uri @index; } location @index { add_header Cache-Control no-cache; expires 0; try_files /index.html =404; }