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 { server {
listen 80; listen 80;
root /usr/share/nginx/html; server_name bymackie.com;
index index.html;
# Dedicated Health Check Endpoint # Using the alias directive is the most reliable way to handle sub-paths
location /health { # in an SPA without triggering port/path redirection loops
return 200 'healthy';
add_header Content-Type text/plain;
}
# Your SPA routing (aliased to handle the sub-path)
location /lab/data-dashboard/ { location /lab/data-dashboard/ {
alias /usr/share/nginx/html/; alias /usr/share/nginx/html/;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
# Fallback for the root domain # SPA fallback for the root path
location / { location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
gzip on;
gzip_types text/css application/javascript application/json;
} }