server { listen 80; server_name bymackie.com; # Using the alias directive is the most reliable way to handle sub-paths # in an SPA without triggering port/path redirection loops location /lab/data-dashboard/ { alias /usr/share/nginx/html/; try_files $uri $uri/ /index.html; } # SPA fallback for the root path location / { root /usr/share/nginx/html; try_files $uri $uri/ /index.html; } }