From 2a71a2437ce8e87efef7bacf00cfeb309cba90f4 Mon Sep 17 00:00:00 2001 From: ZJfans <1062004994@qq.com> Date: Sun, 25 Aug 2024 01:25:31 +0800 Subject: [PATCH] fix: limit_except returns 503 instead of the correct 403 (#11742) --- rootfs/etc/nginx/lua/balancer.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rootfs/etc/nginx/lua/balancer.lua b/rootfs/etc/nginx/lua/balancer.lua index 00104c89d7..11032c2efd 100644 --- a/rootfs/etc/nginx/lua/balancer.lua +++ b/rootfs/etc/nginx/lua/balancer.lua @@ -277,6 +277,11 @@ local function get_balancer() local backend_name = ngx.var.proxy_upstream_name + if backend_name == '-' then + ngx.status = ngx.HTTP_FORBIDDEN + return ngx.exit(ngx.status) + end + local balancer = balancers[backend_name] if not balancer then return nil