mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-10 20:37:18 +08:00
fix: Improve config handling for proxy configuration in GetProxies (#9879)
This commit is contained in:
parent
483b47ad63
commit
3c01198e61
1 changed files with 9 additions and 3 deletions
|
|
@ -1787,9 +1787,15 @@ func (w WebsiteService) GetProxies(id uint) (res []request.WebsiteProxyConfig, e
|
|||
}
|
||||
directives := config.GetDirectives()
|
||||
|
||||
location, ok := directives[0].(*components.Location)
|
||||
if !ok {
|
||||
err = errors.New("error")
|
||||
var location *components.Location
|
||||
for _, directive := range directives {
|
||||
if loc, ok := directive.(*components.Location); ok {
|
||||
location = loc
|
||||
break
|
||||
}
|
||||
}
|
||||
if location == nil {
|
||||
err = errors.New("invalid proxy config, no location found")
|
||||
return
|
||||
}
|
||||
proxyConfig.ProxyPass = location.ProxyPass
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue