mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-11 17:15:44 +08:00
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
This commit is contained in:
parent
99b04e3635
commit
dd6a709053
1 changed files with 6 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue