This commit is contained in:
Mackie 2026-06-08 08:08:15 +08:00
parent 96a1168822
commit 6469bb561a

View file

@ -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;
}