ConfigMaps ConfigMaps allow you to decouple configuration artifacts from image content to keep containerized applications portable.
The ConfigMap API resource stores configuration data as key-value pairs. The data provides the configurations for system components for the nginx-controller.
In order to overwrite nginx-controller configuration values as seen in config.go , you can add key-value pairs to the data section of the config-map. For Example:
data :
map-hash-bucket-size : "128"
ssl-protocols : SSLv2
-
Important
The key and values in a ConfigMap can only be strings. This means that we want a value with boolean values we need to quote the values, like "true" or "false". Same for numbers, like "100".
"Slice" types (defined below as []string
or []int
) can be provided as a comma-delimited string.
Configuration options The following table shows a configuration option's name, type, and the default value:
Sets custom headers from named configmap before sending traffic to the client. See proxy-set-headers . example
Enables the return of the header Server from the backend instead of the generic nginx string. default: is disabled
Sets additional header that will not be passed from the upstream server to the client response. default: empty
References: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_hide_header
access-log-params Additional params for access_log. For example, buffer=16k, gzip, flush=1m
References: http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
access-log-path Access log path for both http and stream context. Goes to /var/log/nginx/access.log
by default.
Note: the file /var/log/nginx/access.log
is a symlink to /dev/stdout
http-access-log-path Access log path for http context globally. default: ""
Note: If not specified, the access-log-path
will be used.
stream-access-log-path Access log path for stream context globally. default: ""
Note: If not specified, the access-log-path
will be used.
enable-access-log-for-default-backend Enables logging access to default backend. default: is disabled.
error-log-path Error log path. Goes to /var/log/nginx/error.log
by default.
Note: the file /var/log/nginx/error.log
is a symlink to /dev/stderr
References: http://nginx.org/en/docs/ngx_core_module.html#error_log
enable-modsecurity Enables the modsecurity module for NGINX. default: is disabled
enable-owasp-modsecurity-crs Enables the OWASP ModSecurity Core Rule Set (CRS). default: is disabled
modsecurity-snippet Adds custom rules to modsecurity section of nginx configuration
Allows to configure a custom buffer size for reading client request header.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_buffer_size
Defines a timeout for reading client request header, in seconds.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_timeout
client-body-buffer-size Sets buffer size for reading client request body.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size
client-body-timeout Defines a timeout for reading client request body, in seconds.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout
disable-access-log Disables the Access Log from the entire Ingress Controller. default: '"false"'
References: http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
disable-ipv6 Disable listening on IPV6. default: false
; IPv6 listening is enabled
disable-ipv6-dns Disable IPV6 for nginx DNS resolver. default: false
; IPv6 resolving enabled.
Enables underscores in header names. default: is disabled
enable-ocsp Enables Online Certificate Status Protocol stapling (OCSP) support. default: is disabled
Set if header fields with invalid names should be ignored. default: is enabled
retry-non-idempotent Since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) in case of an error in the upstream server. The previous behavior can be restored using the value "true".
error-log-level Configures the logging level of errors. Log levels above are listed in the order of increasing severity.
References: http://nginx.org/en/docs/ngx_core_module.html#error_log
http2-max-field-size Limits the maximum size of an HPACK-compressed request header field.
References: https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_field_size
Limits the maximum size of the entire request header list after HPACK decompression.
References: https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_header_size
http2-max-requests Sets the maximum number of requests (including push requests) that can be served through one HTTP/2 connection, after which the next client request will lead to connection closing and the need of establishing a new connection.
References: http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests
http2-max-concurrent-streams Sets the maximum number of concurrent HTTP/2 streams in a connection.
References: http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_concurrent_streams
hsts Enables or disables the header HSTS in servers running SSL. HTTP Strict Transport Security (often abbreviated as HSTS) is a security feature (HTTP header) that tell browsers that it should only be communicated with using HTTPS, instead of using HTTP. It provides protection against protocol downgrade attacks and cookie theft.
References:
hsts-include-subdomains Enables or disables the use of HSTS in all the subdomains of the server-name.
hsts-max-age Sets the time, in seconds, that the browser should remember that this site is only to be accessed using HTTPS.
hsts-preload Enables or disables the preload attribute in the HSTS feature (when it is enabled) dd
keep-alive Sets the time during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout
keep-alive-requests Sets the maximum number of requests that can be served through one keep-alive connection.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests
Sets the maximum number and size of buffers used for reading large client request header. default: 4 8k
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers
Sets if the escape parameter allows JSON ("true") or default characters escaping in variables ("false") Sets the nginx log format .
Sets the nginx log format . Example for json output:
log - f orma t - ups trea m : ' { "time" : "$time_iso8601" , "remote_addr" : "$proxy_protocol_addr" , "x_forward_for" : "$proxy_add_x_forwarded_for" , "request_id" : "$req_id" ,
+
Important
The key and values in a ConfigMap can only be strings. This means that we want a value with boolean values we need to quote the values, like "true" or "false". Same for numbers, like "100".
"Slice" types (defined below as []string
or []int
) can be provided as a comma-delimited string.
Configuration options The following table shows a configuration option's name, type, and the default value:
Sets custom headers from named configmap before sending traffic to the client. See proxy-set-headers . example
Enables the return of the header Server from the backend instead of the generic nginx string. default: is disabled
Sets additional header that will not be passed from the upstream server to the client response. default: empty
References: http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_hide_header
access-log-params Additional params for access_log. For example, buffer=16k, gzip, flush=1m
References: http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
access-log-path Access log path for both http and stream context. Goes to /var/log/nginx/access.log
by default.
Note: the file /var/log/nginx/access.log
is a symlink to /dev/stdout
http-access-log-path Access log path for http context globally. default: ""
Note: If not specified, the access-log-path
will be used.
stream-access-log-path Access log path for stream context globally. default: ""
Note: If not specified, the access-log-path
will be used.
enable-access-log-for-default-backend Enables logging access to default backend. default: is disabled.
error-log-path Error log path. Goes to /var/log/nginx/error.log
by default.
Note: the file /var/log/nginx/error.log
is a symlink to /dev/stderr
References: http://nginx.org/en/docs/ngx_core_module.html#error_log
enable-modsecurity Enables the modsecurity module for NGINX. default: is disabled
enable-owasp-modsecurity-crs Enables the OWASP ModSecurity Core Rule Set (CRS). default: is disabled
modsecurity-snippet Adds custom rules to modsecurity section of nginx configuration
Allows to configure a custom buffer size for reading client request header.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_buffer_size
Defines a timeout for reading client request header, in seconds.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_timeout
client-body-buffer-size Sets buffer size for reading client request body.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size
client-body-timeout Defines a timeout for reading client request body, in seconds.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout
disable-access-log Disables the Access Log from the entire Ingress Controller. default: '"false"'
References: http://nginx.org/en/docs/http/ngx_http_log_module.html#access_log
disable-ipv6 Disable listening on IPV6. default: false
; IPv6 listening is enabled
disable-ipv6-dns Disable IPV6 for nginx DNS resolver. default: false
; IPv6 resolving enabled.
Enables underscores in header names. default: is disabled
enable-ocsp Enables Online Certificate Status Protocol stapling (OCSP) support. default: is disabled
Set if header fields with invalid names should be ignored. default: is enabled
retry-non-idempotent Since 1.9.13 NGINX will not retry non-idempotent requests (POST, LOCK, PATCH) in case of an error in the upstream server. The previous behavior can be restored using the value "true".
error-log-level Configures the logging level of errors. Log levels above are listed in the order of increasing severity.
References: http://nginx.org/en/docs/ngx_core_module.html#error_log
http2-max-field-size Limits the maximum size of an HPACK-compressed request header field.
References: https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_field_size
Limits the maximum size of the entire request header list after HPACK decompression.
References: https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_header_size
http2-max-requests Sets the maximum number of requests (including push requests) that can be served through one HTTP/2 connection, after which the next client request will lead to connection closing and the need of establishing a new connection.
References: http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests
http2-max-concurrent-streams Sets the maximum number of concurrent HTTP/2 streams in a connection.
References: http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_concurrent_streams
hsts Enables or disables the header HSTS in servers running SSL. HTTP Strict Transport Security (often abbreviated as HSTS) is a security feature (HTTP header) that tell browsers that it should only be communicated with using HTTPS, instead of using HTTP. It provides protection against protocol downgrade attacks and cookie theft.
References:
hsts-include-subdomains Enables or disables the use of HSTS in all the subdomains of the server-name.
hsts-max-age Sets the time, in seconds, that the browser should remember that this site is only to be accessed using HTTPS.
hsts-preload Enables or disables the preload attribute in the HSTS feature (when it is enabled) dd
keep-alive Sets the time during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout
keep-alive-requests Sets the maximum number of requests that can be served through one keep-alive connection.
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests
Sets the maximum number and size of buffers used for reading large client request header. default: 4 8k
References: http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers
Sets if the escape parameter allows JSON ("true") or default characters escaping in variables ("false") Sets the nginx log format .
Sets the nginx log format . Example for json output:
log - f orma t - ups trea m : ' { "time" : "$time_iso8601" , "remote_addr" : "$proxy_protocol_addr" , "x_forward_for" : "$proxy_add_x_forwarded_for" , "request_id" : "$req_id" ,
"remote_user" : "$remote_user" , "bytes_sent" : $by tes _se nt , "request_time" : $reques t _ t ime , "status" : $s tatus , "vhost" : "$host" , "request_proto" : "$server_protocol" ,
"path" : "$uri" , "request_query" : "$args" , "request_length" : $reques t _le n g t h , "duration" : $reques t _ t ime , "method" : "$request_method" , "http_referrer" : "$http_referer" ,
"http_user_agent" : "$http_user_agent" } '