server { listen 80; server_name localhost; # Set the root directory for the application root /usr/share/nginx/html; # Default index file index index.html; # Handle routes with Angular's HTML5 mode location / { try_files $uri $uri/ /index.html =404; } }