mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Merge branch 'configfix' into letsencrypt
This commit is contained in:
commit
dd91812b11
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@ package setup
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/mholt/caddy/middleware"
|
||||
|
@ -12,6 +13,12 @@ func TLS(c *Controller) (middleware.Middleware, error) {
|
|||
c.TLS.Enabled = true
|
||||
}
|
||||
|
||||
if c.Port == "http" {
|
||||
c.TLS.Enabled = false
|
||||
log.Printf("Warning: TLS disabled for %s://%s. To force TLS over the plaintext HTTP port, "+
|
||||
"specify port 80 explicitly (https://%s:80).", c.Port, c.Host, c.Host)
|
||||
}
|
||||
|
||||
for c.Next() {
|
||||
args := c.RemainingArgs()
|
||||
switch len(args) {
|
||||
|
|
Loading…
Reference in a new issue