diff --git a/rproxy b/rproxy index a940386..9e5ac95 100644 --- a/rproxy +++ b/rproxy @@ -3,7 +3,7 @@ # Публикация локальных сервисов через SSH-туннели + nginx на VPS # http://5.104.75.50:3000/Petro1990/rProxy -VERSION="1.3.7" +VERSION="1.3.8" CONF_DIR="/opt/etc/rproxy" CONF_FILE="$CONF_DIR/rproxy.conf" SERVICES_DIR="$CONF_DIR/services" @@ -536,6 +536,12 @@ do_add_interactive() { proxy_set_header Content-Length \"\"; proxy_set_header Authorization \$http_authorization; + # Фикс для Keenetic RCI: принудительный 401 вместо 302 редиректа + proxy_set_header X-Requested-With XMLHttpRequest; + proxy_set_header X-NDM-Auth-Type Basic; + proxy_set_header Accept \"application/json\"; + proxy_set_header Cookie \"\"; + # Стелс-режим для авторизации (используем LAN IP роутера) proxy_set_header Host \"$router_ip\"; proxy_set_header Origin \"http://$router_ip\"; @@ -557,6 +563,7 @@ do_add_interactive() { server { listen 80; server_name "$domain"; + recursive_error_pages on; proxy_buffering off; proxy_request_buffering off; @@ -599,6 +606,7 @@ NGINXEOF cat > "$tmp" << NGINXEOF server { listen $ext_port; + recursive_error_pages on; proxy_buffering off; proxy_request_buffering off; @@ -1095,7 +1103,7 @@ do_start_service() { local ssh_opts="-o StrictHostKeyChecking=no -o ServerAliveInterval=10 -o ServerAliveCountMax=3 -o ConnectTimeout=10 -o ExitOnForwardFailure=yes" local tunnel_args="-R 0.0.0.0:$SVC_TUNNEL_PORT:$SVC_TARGET_HOST:$SVC_TARGET_PORT" - [ "$SVC_NDM_AUTH" = "yes" ] && tunnel_args="$tunnel_args -R 0.0.0.0:$((SVC_TUNNEL_PORT+1)):${SVC_ROUTER_IP:-127.0.0.1}:79" + [ "$SVC_NDM_AUTH" = "yes" ] && tunnel_args="$tunnel_args -R 0.0.0.0:$((SVC_TUNNEL_PORT+1)):${SVC_ROUTER_IP:-127.0.0.1}:80" if [ "$VPS_AUTH" = "password" ]; then AUTOSSH_GATETIME=0 sshpass -p "$VPS_PASS" autossh -M 0 -f -N \