server { listen 80; server_name localhost; root /usr/share/nginx/html; auth_basic off; location / { try_files $uri $uri/ /index.html; } # 404 if a file is requested (so the main app isn't served) location ~ ^.+\..+$ { try_files $uri =404; } }