From 41ad555e96c889612f70b40aad3bdf397c1581ec Mon Sep 17 00:00:00 2001 From: Petro1990 Date: Fri, 13 Mar 2026 19:34:38 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81:=20v1.3.3=20-=20=D1=83?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20401=20?= =?UTF-8?q?Unauthorized,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=20=D0=BE=D0=BA=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=B8=20WWW-Authenticate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rproxy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rproxy b/rproxy index 50ce818..48814ea 100644 --- a/rproxy +++ b/rproxy @@ -3,7 +3,7 @@ # Публикация локальных сервисов через SSH-туннели + nginx на VPS # http://5.104.75.50:3000/Petro1990/rProxy -VERSION="1.3.2" +VERSION="1.3.3" CONF_DIR="/opt/etc/rproxy" CONF_FILE="$CONF_DIR/rproxy.conf" SERVICES_DIR="$CONF_DIR/services" @@ -522,6 +522,11 @@ do_add_interactive() { proxy_set_header Origin \"http://$router_ip\"; proxy_set_header Referer \"http://$router_ip/\"; } + + location @auth_required { + add_header WWW-Authenticate 'Basic realm=\"Keenetic NDM Auth\"' always; + return 401; + } " fi @@ -541,6 +546,7 @@ server { location / { $( [ "$use_ndm_auth" = "yes" ] && echo "auth_request /rproxy_auth;" ) + $( [ "$use_ndm_auth" = "yes" ] && echo "error_page 401 = @auth_required;" ) proxy_pass http://127.0.0.1:$tunnel_port; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; @@ -582,6 +588,7 @@ server { location / { $( [ "$use_ndm_auth" = "yes" ] && echo "auth_request /rproxy_auth;" ) + $( [ "$use_ndm_auth" = "yes" ] && echo "error_page 401 = @auth_required;" ) proxy_pass http://127.0.0.1:$tunnel_port; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade;