Add setting to allow returning the Server header from the backend
This commit is contained in:
parent
f00823fd83
commit
2f20c6bfcb
2 changed files with 11 additions and 0 deletions
|
@ -82,6 +82,12 @@ const (
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
defaults.Backend `json:",squash"`
|
defaults.Backend `json:",squash"`
|
||||||
|
|
||||||
|
// AllowBackendServerHeader enables the return of the header Server from the backend
|
||||||
|
// instead of the generic nginx string.
|
||||||
|
// http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_hide_header
|
||||||
|
// By default this is disabled
|
||||||
|
AllowBackendServerHeader bool `json:"allow-backend-server-header"`
|
||||||
|
|
||||||
// EnableDynamicTLSRecords enables dynamic TLS record sizes
|
// EnableDynamicTLSRecords enables dynamic TLS record sizes
|
||||||
// https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency
|
// https://blog.cloudflare.com/optimizing-tls-over-tcp-to-reduce-latency
|
||||||
// By default this is enabled
|
// By default this is enabled
|
||||||
|
@ -280,6 +286,7 @@ type Configuration struct {
|
||||||
// NewDefault returns the default nginx configuration
|
// NewDefault returns the default nginx configuration
|
||||||
func NewDefault() Configuration {
|
func NewDefault() Configuration {
|
||||||
cfg := Configuration{
|
cfg := Configuration{
|
||||||
|
AllowBackendServerHeader: false,
|
||||||
ClientHeaderBufferSize: "1k",
|
ClientHeaderBufferSize: "1k",
|
||||||
ClientBodyBufferSize: "8k",
|
ClientBodyBufferSize: "8k",
|
||||||
EnableDynamicTLSRecords: true,
|
EnableDynamicTLSRecords: true,
|
||||||
|
|
|
@ -216,6 +216,10 @@ http {
|
||||||
|
|
||||||
proxy_ssl_session_reuse on;
|
proxy_ssl_session_reuse on;
|
||||||
|
|
||||||
|
{{ if $cfg.AllowBackendServerHeader }}
|
||||||
|
proxy_pass_header Server;
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{range $name, $upstream := $backends}}
|
{{range $name, $upstream := $backends}}
|
||||||
upstream {{$upstream.Name}} {
|
upstream {{$upstream.Name}} {
|
||||||
{{ if eq $upstream.SessionAffinity.AffinityType "cookie" }}
|
{{ if eq $upstream.SessionAffinity.AffinityType "cookie" }}
|
||||||
|
|
Loading…
Reference in a new issue