1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 修复网站404重定向次数过多 (#3054) (#3056)

Refs #3054
This commit is contained in:
igophper 2023-11-27 13:58:22 +08:00 committed by wanghe-fit2cloud
parent f8e344db76
commit b1935d8368

View File

@ -2093,15 +2093,8 @@ func (w WebsiteService) OperateRedirect(req request.NginxRedirectReq) (err error
})
}
case "404":
if req.KeepPath && !req.RedirectRoot {
target = req.Target + "$request_uri"
}
if req.RedirectRoot {
target = "/"
} else {
if req.KeepPath {
target = req.Target + "$request_uri"
}
}
block = &components.Block{
Directives: []components.IDirective{
@ -2116,7 +2109,7 @@ func (w WebsiteService) OperateRedirect(req request.NginxRedirectReq) (err error
Directives: []components.IDirective{
&components.Directive{
Name: "return",
Parameters: []string{"301", target},
Parameters: []string{req.Redirect, target},
},
},
},