fix and update
This commit is contained in:
15
install.sh
15
install.sh
@@ -1942,10 +1942,7 @@ nginx_proxy_headers=" proxy_set_header Host \$host;
|
||||
proxy_set_header X-Forwarded-Host \$host;
|
||||
proxy_set_header Authorization \$http_authorization;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_connect_timeout 75s;
|
||||
proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;
|
||||
proxy_next_upstream_tries 2;
|
||||
proxy_next_upstream_timeout 10s;"
|
||||
proxy_connect_timeout 75s;"
|
||||
|
||||
# Встроенный DNS Docker. В docker-режиме nginx обязан перерезолвлять имена
|
||||
# бэкенд-контейнеров на каждый запрос — иначе после пересборки контейнера
|
||||
@@ -1986,16 +1983,16 @@ render_proxy_rewrite() {
|
||||
fi
|
||||
}
|
||||
|
||||
# proxy_pass для /idp-api/ — named capture надёжнее rewrite+break с переменной upstream.
|
||||
# proxy_pass для /idp-api/ — prefix ^~ выше regex; rewrite снимает префикс перед api-gateway.
|
||||
render_proxy_idp_api() {
|
||||
local key="api" up var
|
||||
up="$(nginx_upstream "$key")"
|
||||
if [[ "$NGINX_MODE" == "docker" ]]; then
|
||||
var="$(nginx_upstream_var "$key")"
|
||||
printf '%s\n set $%s %s;\n proxy_pass $%s/$api_path$is_args$args;' \
|
||||
printf '%s\n set $%s %s;\n rewrite ^/idp-api/?(.*)$ /$1 break;\n proxy_pass $%s;' \
|
||||
"$NGINX_DOCKER_RESOLVER" "$var" "$up" "$var"
|
||||
else
|
||||
printf ' proxy_pass %s/$api_path$is_args$args;' "$up"
|
||||
printf ' rewrite ^/idp-api/?(.*)$ /$1 break;\n proxy_pass %s;' "$up"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -2190,7 +2187,7 @@ ${proxy_ws}
|
||||
proxy_connect_timeout 75s;
|
||||
}
|
||||
|
||||
location ~ ^/idp-api/(?<api_path>.*)$ {
|
||||
location ^~ /idp-api/ {
|
||||
${proxy_idp}
|
||||
proxy_http_version 1.1;
|
||||
${nginx_proxy_headers}
|
||||
@@ -2501,7 +2498,7 @@ validate_docker_frontend_nginx_config() {
|
||||
local conf="${LOCAL_CONF_DIR}/${NGINX_PREFIX}-frontend.conf"
|
||||
[[ -f "$conf" ]] || fail "Не найден ${conf} — конфиг SSO-домена не записан"
|
||||
|
||||
if ! grep -q 'location.*idp-api' "$conf" 2>/dev/null; then
|
||||
if ! grep -q 'location \^~ /idp-api/' "$conf" 2>/dev/null && ! grep -q 'location.*idp-api' "$conf" 2>/dev/null; then
|
||||
fail "Конфиг ${conf} без location /idp-api — браузер SPA получит 502. Выполните ./install.sh --fix-all"
|
||||
fi
|
||||
if ! grep -q 'resolver 127.0.0.11' "$conf" 2>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user