@marcel91200 / caddy Mirror · read-only / commits / 7f9b1f43
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 13, 16:45 UTC

reverseproxy: Correct the `tls_server_name` docs (#4827)

* reverseproxy: Correct the `tls_server_name` docs * Update modules/caddyhttp/reverseproxy/httptransport.go Co-authored-by: Matt Holt <mholt@users.noreply.github.com> Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

Francis Lavoie committed Jun 6, 2022 at 14:37 UTC 7f9b1f43c9f8c7d0f4ca9271090cae92103232c7
1 file changed +12 -5
modules/caddyhttp/reverseproxy/httptransport.go
+12 -5
@@ -315,7 +315,14 @@ type TLSConfig struct {
315 // The duration to allow a TLS handshake to a server. Default: No timeout.
316 HandshakeTimeout caddy.Duration `json:"handshake_timeout,omitempty"`
317
318 - // The server name (SNI) to use in TLS handshakes.
318 + // The server name used when verifying the certificate received in the TLS
319 + // handshake. By default, this will use the upstream address' host part.
320 + // You only need to override this if your upstream address does not match the
321 + // certificate the upstream is likely to use. For example if the upstream
322 + // address is an IP address, then you would need to configure this to the
323 + // hostname being served by the upstream server. Currently, this does not
324 + // support placeholders because the TLS config is not provisioned on each
325 + // connection, so a static value must be used.
326 ServerName string `json:"server_name,omitempty"`
327 }
328
@@ -386,7 +393,7 @@ func (t TLSConfig) MakeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
393 cfg.RootCAs = rootPool
394 }
395
389 - // custom SNI
396 + // override for the server name used verify the TLS handshake
397 cfg.ServerName = t.ServerName
398
399 // throw all security out the window
@@ -402,16 +409,16 @@ func (t TLSConfig) MakeTLSClientConfig(ctx caddy.Context) (*tls.Config, error) {
409
410 // KeepAlive holds configuration pertaining to HTTP Keep-Alive.
411 type KeepAlive struct {
405 - // Whether HTTP Keep-Alive is enabled. Default: true
412 + // Whether HTTP Keep-Alive is enabled. Default: `true`
413 Enabled *bool `json:"enabled,omitempty"`
414
415 // How often to probe for liveness. Default: `30s`.
416 ProbeInterval caddy.Duration `json:"probe_interval,omitempty"`
417
411 - // Maximum number of idle connections. Default: 0, which means no limit.
418 + // Maximum number of idle connections. Default: `0`, which means no limit.
419 MaxIdleConns int `json:"max_idle_conns,omitempty"`
420
414 - // Maximum number of idle connections per host. Default: 32.
421 + // Maximum number of idle connections per host. Default: `32`.
422 MaxIdleConnsPerHost int `json:"max_idle_conns_per_host,omitempty"`
423
424 // How long connections should be kept alive when idle. Default: `2m`.