mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-19 05:52:45 +08:00
http: Don't use a Host matcher for HTTP->HTTPS redirects
In case on-demand TLS is enabled, in that case we don't know the only names that have automatic HTTPS. See https://caddy.community/t/v2-http-to-https-redirects-fail-for-on-demand-ssl-certs/6742?u=matt
This commit is contained in:
parent
590480513a
commit
994b9033e9
|
@ -486,12 +486,7 @@ func (app *App) automaticHTTPS() error {
|
|||
// create the route that does the redirect and associate
|
||||
// it with the listener address it will be served from
|
||||
lnAddrRedirRoutes[httpRedirLnAddr] = Route{
|
||||
MatcherSets: []MatcherSet{
|
||||
{
|
||||
MatchProtocol("http"),
|
||||
MatchHost(domains),
|
||||
},
|
||||
},
|
||||
MatcherSets: []MatcherSet{{MatchProtocol("http")}},
|
||||
Handlers: []MiddlewareHandler{
|
||||
StaticResponse{
|
||||
StatusCode: WeakString(strconv.Itoa(http.StatusPermanentRedirect)),
|
||||
|
|
Loading…
Reference in New Issue
Block a user