From ef947d9888de94ffd4874c54747491107bf0f917 Mon Sep 17 00:00:00 2001 From: boris Date: Tue, 30 Sep 2025 12:39:49 +0100 Subject: [PATCH] Migrated CI health test to new JSON. Refactored NGINX config --- nginx/configs/nginx.conf | 17 +---------------- nginx/configs/sites/default.conf | 8 +++----- tests/test_health.py | 4 ++-- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/nginx/configs/nginx.conf b/nginx/configs/nginx.conf index b1d0a83..5c31de9 100644 --- a/nginx/configs/nginx.conf +++ b/nginx/configs/nginx.conf @@ -20,22 +20,7 @@ http { '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; - - server_tokens off; - - sendfile on; - tcp_nopush on; - - keepalive_timeout 60; - tcp_nodelay on; - client_body_timeout 15; - - gzip on; - gzip_vary on; - gzip_min_length 1k; - client_max_body_size 10G; - proxy_request_buffering off; + access_log /var/log/nginx/access.log main; include /etc/nginx/conf.d/*.conf; types_hash_bucket_size 128; diff --git a/nginx/configs/sites/default.conf b/nginx/configs/sites/default.conf index 7a73486..904d3f3 100644 --- a/nginx/configs/sites/default.conf +++ b/nginx/configs/sites/default.conf @@ -25,13 +25,11 @@ server { } - # NOT FOR PROD - location /docs { - proxy_pass http://keywarden-api:8000; - } - location /openapi.json { + # NOT FOR PROD vvv + location ~ ^/(docs|openapi.json)$ { proxy_pass http://keywarden-api:8000; } + ## REMOVE IN PRODUCTION BUILDS ^^^ location /api/v1/ { proxy_pass http://keywarden-api:8000; diff --git a/tests/test_health.py b/tests/test_health.py index 50ab6ab..bdd0961 100644 --- a/tests/test_health.py +++ b/tests/test_health.py @@ -8,6 +8,6 @@ from app.main import app def test_healthz(): client = TestClient(app) - r = client.get("/healthz") + r = client.get("/readyz") assert r.status_code == 200 - assert r.json() == {"ok": True} \ No newline at end of file + assert r.json() == {"status": "ok", "db": "up"} \ No newline at end of file