Merge pull request #3640 from shaikatz/limit-con-status-code

add limit connection status code
This commit is contained in:
Kubernetes Prow Robot 2019-01-09 14:11:27 -08:00 committed by GitHub
commit f464f0e138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -146,6 +146,7 @@ The following table shows a configuration option's name, type, and the default v
|[http-redirect-code](#http-redirect-code)|int|308| |[http-redirect-code](#http-redirect-code)|int|308|
|[proxy-buffering](#proxy-buffering)|string|"off"| |[proxy-buffering](#proxy-buffering)|string|"off"|
|[limit-req-status-code](#limit-req-status-code)|int|503| |[limit-req-status-code](#limit-req-status-code)|int|503|
|[limit-conn-status-code](#limit-conn-status-code)|int|503|
|[no-tls-redirect-locations](#no-tls-redirect-locations)|string|"/.well-known/acme-challenge"| |[no-tls-redirect-locations](#no-tls-redirect-locations)|string|"/.well-known/acme-challenge"|
|[no-auth-locations](#no-auth-locations)|string|"/.well-known/acme-challenge"| |[no-auth-locations](#no-auth-locations)|string|"/.well-known/acme-challenge"|
|[block-cidrs](#block-cidrs)|[]string|""| |[block-cidrs](#block-cidrs)|[]string|""|
@ -827,6 +828,10 @@ Enables or disables [buffering of responses from the proxied server](http://ngin
Sets the [status code to return in response to rejected requests](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_status). _**default:**_ 503 Sets the [status code to return in response to rejected requests](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req_status). _**default:**_ 503
## limit-conn-status-code
Sets the [status code to return in response to rejected connections](http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html#limit_conn_status). _**default:**_ 503
## no-tls-redirect-locations ## no-tls-redirect-locations
A comma-separated list of locations on which http requests will never get redirected to their https counterpart. A comma-separated list of locations on which http requests will never get redirected to their https counterpart.

View file

@ -519,6 +519,11 @@ type Configuration struct {
// Default: 503 // Default: 503
LimitReqStatusCode int `json:"limit-req-status-code"` LimitReqStatusCode int `json:"limit-req-status-code"`
// LimitConnStatusCode Sets the status code to return in response to rejected connections.
// http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html#limit_conn_status
// Default: 503
LimitConnStatusCode int `json:"limit-conn-status-code"`
// EnableSyslog enables the configuration for remote logging in NGINX // EnableSyslog enables the configuration for remote logging in NGINX
EnableSyslog bool `json:"enable-syslog"` EnableSyslog bool `json:"enable-syslog"`
// SyslogHost FQDN or IP address where the logs should be sent // SyslogHost FQDN or IP address where the logs should be sent
@ -675,6 +680,7 @@ func NewDefault() Configuration {
JaegerSamplerType: "const", JaegerSamplerType: "const",
JaegerSamplerParam: "1", JaegerSamplerParam: "1",
LimitReqStatusCode: 503, LimitReqStatusCode: 503,
LimitConnStatusCode: 503,
SyslogPort: 514, SyslogPort: 514,
NoTLSRedirectLocations: "/.well-known/acme-challenge", NoTLSRedirectLocations: "/.well-known/acme-challenge",
NoAuthLocations: "/.well-known/acme-challenge", NoAuthLocations: "/.well-known/acme-challenge",

View file

@ -198,6 +198,7 @@ http {
ignore_invalid_headers {{ if $cfg.IgnoreInvalidHeaders }}on{{ else }}off{{ end }}; ignore_invalid_headers {{ if $cfg.IgnoreInvalidHeaders }}on{{ else }}off{{ end }};
limit_req_status {{ $cfg.LimitReqStatusCode }}; limit_req_status {{ $cfg.LimitReqStatusCode }};
limit_conn_status {{ $cfg.LimitConnStatusCode }};
{{ if $cfg.EnableOpentracing }} {{ if $cfg.EnableOpentracing }}
opentracing on; opentracing on;