mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
fix: 解决停止一键部署网站失败的问题 (#930)
This commit is contained in:
parent
54bc33a1a2
commit
ed3e7e7c26
@ -504,7 +504,7 @@ func opWebsite(website *model.Website, operate string) error {
|
||||
|
||||
switch website.Type {
|
||||
case constant.Deployment:
|
||||
server.RemoveDirective("location", []string{"", "/"})
|
||||
server.RemoveDirective("location", []string{"/"})
|
||||
case constant.Runtime:
|
||||
server.RemoveDirective("location", []string{"~", "[^/]\\.php(/|$)"})
|
||||
}
|
||||
|
@ -5,9 +5,8 @@ import (
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Comment string
|
||||
Listens []*ServerListen
|
||||
//Locations []*Location
|
||||
Comment string
|
||||
Listens []*ServerListen
|
||||
Directives []IDirective
|
||||
Line int
|
||||
}
|
||||
@ -22,15 +21,6 @@ func NewServer(directive IDirective) (*Server, error) {
|
||||
switch dir.GetName() {
|
||||
case "listen":
|
||||
server.Listens = append(server.Listens, NewServerListen(dir.GetParameters(), dir.GetLine()))
|
||||
//case "location":
|
||||
// locationDirective := &Directive{
|
||||
// Name: "location",
|
||||
// Parameters: dir.GetParameters(),
|
||||
// Block: dir.GetBlock(),
|
||||
// Line: dir.GetLine(),
|
||||
// Comment: dir.GetComment(),
|
||||
// }
|
||||
// server.Locations = append(server.Locations, NewLocation(locationDirective))
|
||||
default:
|
||||
server.Directives = append(server.Directives, dir)
|
||||
}
|
||||
@ -61,9 +51,6 @@ func (s *Server) GetDirectives() []IDirective {
|
||||
for _, ls := range s.Listens {
|
||||
directives = append(directives, ls)
|
||||
}
|
||||
//for _, la := range s.Locations {
|
||||
// directives = append(directives, la)
|
||||
//}
|
||||
directives = append(directives, s.Directives...)
|
||||
return directives
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user