ab3a787da5
- новый Spring Cloud Gateway (WebFlux): доменные маршруты /api/pcp-<x>/**
со StripPrefix=2, /api/stations без среза пути, catch-all /api/** → ui-service;
опциональная JWT-валидация на edge (gateway.security.jwt-enabled, по умолчанию off)
- config-repo: pcp-gateway-service.yaml (маршруты) + порт/адрес gateway в реестрах
application-{local,docker-local,dev}
- build: репозитории переведены на mavenCentral (nstart-proxy закомментирован),
включены mavenLocal/gradlePluginPortal; settings: include модуля
- pcp-tgu-ui-service: vite-proxy и nginx.conf свёрнуты на единый /api → gateway
(вместо набора per-service правил)
- deploy: сервис gateway в docker-compose; helm-чарт pcp-gateway-service
- CI: .gitlab/ci/pcp-gateway-service.yml + проводка в .gitlab-ci.yml
43 lines
1.5 KiB
Nginx Configuration File
43 lines
1.5 KiB
Nginx Configuration File
server {
|
|
listen 8081;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
location = /healthz {
|
|
access_log off;
|
|
return 200 "ok\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
|
|
location = /config.js {
|
|
expires -1;
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location ~* \.(js|css|png|svg|ico|woff2|woff|ttf)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# --- ТГУ: вся маршрутизация /api/* уходит на gateway (Spring Cloud Gateway).
|
|
# Gateway сам срезает префиксы pcp-* (StripPrefix) и выбирает бэкенд —
|
|
# см. config-repo/pcp-gateway-service.yaml. Здесь прозрачный reverse-proxy:
|
|
# proxy_pass БЕЗ URI-части → путь /api/... передаётся gateway без изменений
|
|
# (он разбирает его сам). Это заменяет прежний набор per-service location'ов.
|
|
# Адрес gateway в кластере — pcp-gateway-service:8080 (dev/master-профиль).
|
|
location /api/ {
|
|
proxy_pass http://pcp-gateway-service:8080;
|
|
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_read_timeout 60s;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|