Add configoption to exclude routes from tls upgrading (#2203)

* Add configoption to exclude routes from tls upgrading

* Add tests for IsLocationInLocationList

* Seperate elements in NoTLSRedirectLocations by comma

* Set NoTLSRedirectLocations to "/.well-known/acme-challenge/" by default

* Remove trailing slash from "/.well-known/acme-challenge" default
This commit is contained in:
Alvaro Aleman 2018-03-18 21:44:59 +01:00 committed by Manuel Alejandro de Brito Fontes
parent 977cfcb4c7
commit 94deb3a01a
5 changed files with 60 additions and 1 deletions

View file

@ -490,6 +490,10 @@ type Configuration struct {
SyslogHost string `json:"syslog-host"`
// SyslogPort port
SyslogPort int `json:"syslog-port",omitempty`
// NoTLSRedirectLocations is a comma-separated list of locations
// that should not get redirected to TLS
NoTLSRedirectLocations string `json:"no-tls-redirect-locations"`
}
// NewDefault returns the default nginx configuration
@ -587,6 +591,7 @@ func NewDefault() Configuration {
JaegerSamplerParam: "1",
LimitReqStatusCode: 503,
SyslogPort: 514,
NoTLSRedirectLocations: "/.well-known/acme-challenge",
}
if glog.V(5) {