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; } }