改进健康检查

This commit is contained in:
05412 2024-08-14 14:31:55 +08:00
parent aa81a4646a
commit de66a3ebf9
2 changed files with 6 additions and 1 deletions

View File

@ -9,7 +9,7 @@ services:
- "./dist:/usr/share/nginx/html:ro" - "./dist:/usr/share/nginx/html:ro"
- "./nginx.conf:/etc/nginx/nginx.conf" - "./nginx.conf:/etc/nginx/nginx.conf"
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"] test: ["CMD", "curl", "-f", "http://localhost/health"]
interval: 30s interval: 30s
timeout: 10s timeout: 10s
retries: 5 retries: 5

View File

@ -46,6 +46,11 @@ http {
index index.html index.htm; index index.html index.htm;
} }
location /health {
add_header Content-Type text/plain;
return 200 "OK";
}
#error_page 404 /404.html; #error_page 404 /404.html;