fix(admin-ui): resolver 169.254.25.10 для dynamic proxy_pass
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 в момент запроса.
This commit is contained in:
@@ -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/<name>/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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user