mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-03 12:29:03 +08:00
fix: 解决默认网站开启 https 443 端口没有设置 default_server 的问题 (#1034)
This commit is contained in:
parent
2ae1db4730
commit
25c2246782
@ -371,8 +371,8 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.We
|
||||
}
|
||||
config := nginxFull.SiteConfig.Config
|
||||
server := config.FindServers()[0]
|
||||
server.UpdateListen("443", false, "ssl")
|
||||
server.UpdateListen("[::]:443", false, "ssl")
|
||||
server.UpdateListen("443", website.DefaultServer, "ssl")
|
||||
server.UpdateListen("[::]:443", website.DefaultServer, "ssl")
|
||||
|
||||
switch req.HttpConfig {
|
||||
case constant.HTTPSOnly:
|
||||
@ -381,11 +381,11 @@ func applySSL(website model.Website, websiteSSL model.WebsiteSSL, req request.We
|
||||
server.RemoveDirective("if", []string{"($scheme"})
|
||||
case constant.HTTPToHTTPS:
|
||||
server.UpdateListen("80", website.DefaultServer)
|
||||
server.UpdateListen("[::]:80", false)
|
||||
server.UpdateListen("[::]:80", website.DefaultServer)
|
||||
server.AddHTTP2HTTPS()
|
||||
case constant.HTTPAlso:
|
||||
server.UpdateListen("80", website.DefaultServer)
|
||||
server.UpdateListen("[::]:80", false)
|
||||
server.UpdateListen("[::]:80", website.DefaultServer)
|
||||
server.RemoveDirective("if", []string{"($scheme"})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user