Add IdleConnTimeout to Traefik's http.server settings (#1340)

* Add IdleTimeout setting to http.server

Without such a timeout there is a risk of resource leakage from piling up connections, particularly when exposing Traefik to the Internet.

Set the default to be 180 seconds

* Add IdleConnTimeout to Traefik's http.server settings

Without enforcing a timeout Traefik is susceptible to resource leakage, particularly when deployed as a public facing proxy exposed to the Internet.

Set the default to be 180 seconds

* tweak

* Update configuration.go

* add some documentation for the idletimeout setting

* need to cast idletimeout

* update doc to refect format specifics
This commit is contained in:
Ben Parli 2017-04-04 02:36:23 -07:00 committed by Emile Vauge
parent 7d256c9bb9
commit c9d23494b9
4 changed files with 27 additions and 8 deletions

View file

@ -17,11 +17,10 @@ import (
"reflect"
"regexp"
"sort"
"sync"
"syscall"
"time"
"sync"
"github.com/codegangsta/negroni"
"github.com/containous/mux"
"github.com/containous/traefik/cluster"
@ -532,9 +531,10 @@ func (server *Server) prepareServer(entryPointName string, router *middlewares.H
}
return &http.Server{
Addr: entryPoint.Address,
Handler: negroni,
TLSConfig: tlsConfig,
Addr: entryPoint.Address,
Handler: negroni,
TLSConfig: tlsConfig,
IdleTimeout: time.Duration(server.globalConfiguration.IdleTimeout),
}, nil
}