mirror of https://github.com/1Panel-dev/1Panel
fix: 解决取消HTTPS报错的BUG
parent
b66108ab4a
commit
1f717bea0e
|
@ -364,6 +364,11 @@ func (w WebsiteService) OpWebsiteHTTPS(req dto.WebsiteHTTPSOp) (dto.WebsiteHTTPS
|
|||
} else {
|
||||
website.Protocol = constant.ProtocolHTTP
|
||||
website.WebSiteSSLID = 0
|
||||
|
||||
if err := deleteListenAndServerName(website, []int{443}, []string{}); err != nil {
|
||||
return dto.WebsiteHTTPS{}, err
|
||||
}
|
||||
|
||||
if err := deleteNginxConfig(website, getKeysFromStaticFile(dto.SSL)); err != nil {
|
||||
return dto.WebsiteHTTPS{}, err
|
||||
}
|
||||
|
|
|
@ -404,7 +404,7 @@ func applySSL(website model.WebSite, websiteSSL model.WebSiteSSL) error {
|
|||
}
|
||||
config := nginxConfig.Config
|
||||
server := config.FindServers()[0]
|
||||
server.UpdateListen("443", false)
|
||||
server.UpdateListen("443", false, "ssl")
|
||||
if err := nginx.WriteConfig(config, nginx.IndentedStyle); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue