/
Al
/
TESamples
Обзор
Документация
Войти
/
Al
/
TESamples
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
apps/spa/nginx.conf
36 строк
1 KB
Al
Initial Commit
11 май 2026, 17:40
11 май 2026, 17:40
0a04577
Код
Авторство
О чём код?
# ============================================================= # SPA serving + BFF proxy. Same-origin для SPA + BFF endpoints. # ============================================================= server { listen 8080; server_name _; root /usr/share/nginx/html; index index.html; # Static SPA files location / { try_files $uri $uri/ /index.html; } # /auth/* и /api/* → BFF. # /api/* мапится в BFF без префикса (BFF не знает про /api). location /auth/ { proxy_pass http://bff-agent:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; # Cookies нужно forwardить как есть (включая Set-Cookie от BFF). proxy_pass_request_headers on; } location /api/ { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://bff-agent:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass_request_headers on; } }