From 8e97c50e6c9755c6ff8e79eea31390f59ed9412f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B8=D0=BC=D0=B8=D0=BD?= Date: Mon, 4 May 2026 01:16:09 +0300 Subject: [PATCH] =?UTF-8?q?fix(admin-ui):=20resolver=20169.254.25.10=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20dynamic=20proxy=5Fpass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nginx с переменной в proxy_pass требует resolver. Ставим nodelocal-dns (169.254.25.10 на kubespray-кластерах) с публичным fallback (1.1.1.1). Это снимает 502 Bad Gateway на /api/v1/* — раньше nginx не мог зарезолвить ordinis-read-api/ordinis-app в момент запроса. --- ordinis-admin-ui/nginx.conf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ordinis-admin-ui/nginx.conf b/ordinis-admin-ui/nginx.conf index 69875a0..bab5399 100644 --- a/ordinis-admin-ui/nginx.conf +++ b/ordinis-admin-ui/nginx.conf @@ -2,18 +2,19 @@ server { listen 80; server_name _; + # Resolver для динамического k8s service DNS (proxy_pass с переменной). + # 169.254.25.10 — nodelocal-dns на kubespray-кластерах (cluster.265 и .264). + resolver 169.254.25.10 1.1.1.1 valid=30s ipv6=off; + # Real client IP behind ingress-nginx. set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For; real_ip_recursive on; - # SPA history fallback. root /usr/share/nginx/html; index index.html; - # GET /api/v1/dictionaries и /api/v1//records → read-api. - # POST/PUT/PATCH/DELETE на тех же путях → writer (ordinis-app). - # Method-based routing через map. + # GET → read-api, мутирующие → writer. location /api/v1/ { set $backend "ordinis-read-api"; if ($request_method ~ ^(POST|PUT|PATCH|DELETE)$) { @@ -28,6 +29,7 @@ server { proxy_pass_request_headers on; } + # SPA history fallback. location / { try_files $uri $uri/ /index.html; }