nginx error with Angular routing

404 Not Found

nginx/1.14.0 (Ubuntu)

Solution:

/etc/nginx/sites-available/yoursite

#change this line:
try_files $uri $uri/ =404;
#to this:
try_files $uri $uri/ /index.html;
#then restart nginx
sudo systemctl restart nginx

Angular setup

// create new app
ng new <PROJECT_NAME>
cd <PROJECT_NAME>

// install angular material
npm i @angular/material @angular/animations @angular/cdk hammerjs

// generate components
ng g c <COMPONENT_NAME>

// generate services
ng g s <SERVICE_NAME>