diff --git a/nginx.conf b/nginx.conf index 929e5ef..9e673aa 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,25 +1,17 @@ server { listen 80; - root /usr/share/nginx/html; - index index.html; + server_name bymackie.com; - # Dedicated Health Check Endpoint - location /health { - return 200 'healthy'; - add_header Content-Type text/plain; - } - - # Your SPA routing (aliased to handle the sub-path) + # 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; } - # Fallback for the root domain + # SPA fallback for the root path location / { + root /usr/share/nginx/html; try_files $uri $uri/ /index.html; } - - gzip on; - gzip_types text/css application/javascript application/json; } \ No newline at end of file