From dd6a709053a727d29bf7c87bccd4c873245a99fa Mon Sep 17 00:00:00 2001 From: KOMATA <20227709+HynoR@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:00:35 +0800 Subject: [PATCH] fix: resolve null destination when enabling AntiLeech for deployment mode websites (#10125) * fix: Add proxy_pass directive for deployment model in UpdateAntiLeech * fix: Update UpdateAntiLeech to use constant for deployment type --- agent/app/service/website.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/app/service/website.go b/agent/app/service/website.go index 36f9e55b2..b7c45e75f 100644 --- a/agent/app/service/website.go +++ b/agent/app/service/website.go @@ -2278,6 +2278,12 @@ func (w WebsiteService) UpdateAntiLeech(req request.NginxAntiLeechUpdate) (err e }, } newBlock.Directives = append(newBlock.Directives, ifDir) + if website.Type == constant.Deployment { + newBlock.Directives = append(newBlock.Directives, &components.Directive{ + Name: "proxy_pass", + Parameters: []string{fmt.Sprintf("http://%s", website.Proxy)}, + }) + } newDirective.Block = newBlock index := -1 for i, directive := range block.Directives {