From c86ce8c8d5966470d38e0e88e6c138070c8c327b Mon Sep 17 00:00:00 2001 From: "Zimin A.N." Date: Sat, 16 May 2026 19:51:04 +0300 Subject: [PATCH] =?UTF-8?q?fix(nginx):=20route=20/api/v1/ai/*=20=D0=BA=20w?= =?UTF-8?q?riter=20(=D0=B1=D1=8B=D0=BB=20fall-through=20=D0=BA=20read-api?= =?UTF-8?q?=20=E2=86=92=20500)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit После !234 ship'нул AiSchemaController на writer, frontend hit /api/v1/ai/info получает 500 — generic /api/v1/ location route к read-api который не имеет этих handlers. Тот же pattern fix что для /drafts/, /me/, /admin/ — explicit location к writer перед generic /api/v1/ fallback. Без этого AI feature unusable в staging (даже если backend healthy). --- ordinis-admin-ui/nginx.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ordinis-admin-ui/nginx.conf b/ordinis-admin-ui/nginx.conf index 37a4a0d..100e6fa 100644 --- a/ordinis-admin-ui/nginx.conf +++ b/ordinis-admin-ui/nginx.conf @@ -115,6 +115,22 @@ server { proxy_pass_request_headers on; } + # /api/v1/ai/* — AI Schema Assist (LlmAdapter + AiSchemaController). Writer + # only — read-api не подключает ordinis-rest-api ai package. Без явного + # правила generic /api/v1/ ниже → read-api → 500 NoResourceFoundException. + # Conditional на ordinis.ai.enabled — если flag off, controller бесконечно + # не зарегистрирован, writer возвращает 404 чисто (frontend hides UI). + location ~ ^/api/v1/ai(/|$) { + set $backend "ordinis-app.${ORDINIS_NAMESPACE}.svc.${CLUSTER_DOMAIN}"; + proxy_pass http://$backend$request_uri; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass_request_headers on; + } + # Swagger UI + OpenAPI spec на writer (там обвязаны контроллеры). location ~ ^/(swagger-ui|v3/api-docs|swagger-resources|webjars/swagger-ui) { set $backend "ordinis-app.${ORDINIS_NAMESPACE}.svc.${CLUSTER_DOMAIN}";