fix: 解决取消HTTPS报错的BUG

pull/54/head
zhengkunwang223 2 years ago committed by zhengkunwang223
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…
Cancel
Save