diff --git a/backend/app/service/website.go b/backend/app/service/website.go index 6382eb377..2ec880c42 100644 --- a/backend/app/service/website.go +++ b/backend/app/service/website.go @@ -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 } diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index 6bc625686..b1ef97337 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -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 }