[REV] Update https support

This commit is contained in:
pujielan 2018-01-03 15:37:47 +08:00
parent b24366d397
commit 2da0f6d4a0

View File

@ -470,14 +470,14 @@ func (n *nginxAPI) addDomain(ads *AddDomainS) bool {
httpsInfo.WriteString(`https=true`)
httpsInfo.WriteString(fmt.Sprintf(`&cert_name=%s&`, ads.CertificateName))
httpsInfo.WriteString(string(upstream))
logrus.Debugf("https info is %v", *httpsInfo)
logrus.Debugf("https info is %v", string(httpsInfo.Bytes()))
pha.UpStream = httpsInfo.Bytes()
} else if ads.TransferHTTP && ads.CertificateName != "" {
httpsInfo := bytes.NewBuffer(nil)
httpsInfo.WriteString(`tran_https=true`)
httpsInfo.WriteString(fmt.Sprintf(`&cert_name=%s&`, ads.CertificateName))
httpsInfo.WriteString(string(upstream))
logrus.Debugf("trans https info is %v", *httpsInfo)
logrus.Debugf("trans https info is %v", string(httpsInfo.Bytes()))
pha.UpStream = httpsInfo.Bytes()
}
n.pHTTPDomain(ads.Domain, pha)