@marcel91200 / caddy Mirror · read-only / commits / 238914d7
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

Some misc. cleanup

The fastcgi changes came from v1 which don't make sense in v2. Fix comment about default value in reverse proxy keep alive.

Matthew Holt committed Jun 16, 2021 at 14:29 UTC 238914d70b0f6c277494f0296a15eb9eb84ecc76
2 files changed +3 -9
modules/caddyhttp/reverseproxy/fastcgi/fastcgi.go
+2 -8
@@ -236,13 +236,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
236 // original URI in as the value of REQUEST_URI (the user can overwrite this
237 // if desired). Most PHP apps seem to want the original URI. Besides, this is
238 // how nginx defaults: http://stackoverflow.com/a/12485156/1048862
239 - origReq, ok := r.Context().Value(caddyhttp.OriginalRequestCtxKey).(http.Request)
240 - if !ok {
241 - // some requests, like active health checks, don't add this to
242 - // the request context, so we can just use the current URL
243 - origReq = *r
244 - }
245 - reqURL := origReq.URL
239 + origReq := r.Context().Value(caddyhttp.OriginalRequestCtxKey).(http.Request)
240
241 requestScheme := "http"
242 if r.TLS != nil {
@@ -285,7 +279,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
279 "DOCUMENT_ROOT": root,
280 "DOCUMENT_URI": docURI,
281 "HTTP_HOST": r.Host, // added here, since not always part of headers
288 - "REQUEST_URI": reqURL.RequestURI(),
282 + "REQUEST_URI": origReq.URL.RequestURI(),
283 "SCRIPT_FILENAME": scriptFilename,
284 "SCRIPT_NAME": scriptName,
285 }
modules/caddyhttp/reverseproxy/httptransport.go
+1 -1
@@ -411,7 +411,7 @@ type KeepAlive struct {
411 // Maximum number of idle connections. Default: 0, which means no limit.
412 MaxIdleConns int `json:"max_idle_conns,omitempty"`
413
414 - // Maximum number of idle connections per host. Default: 0, which uses Go's default of 2.
414 + // Maximum number of idle connections per host. Default: 32.
415 MaxIdleConnsPerHost int `json:"max_idle_conns_per_host,omitempty"`
416
417 // How long connections should be kept alive when idle. Default: 0, which means no timeout.