Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] THREESCALE-10164 Including the env var LARGE_CLIENT_HEADER_BUFFERS #1429

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,13 @@ connections.
By default Gateway does not enable it, and the keepalive timeout on nginx is set
to [75 seconds](http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout)

### `LARGE_CLIENT_HEADER_BUFFERS`

**Default:** 4 8k
**Value:** string

This environment variable sets the maximum number and size of buffers for reading large client request headers. A request line cannot exceed the size of one buffer, or the client receives a 414 (Request-URI Too Large) error. A request header field cannot exceed the size of one buffer or the client receives a 400 (Bad Request) error. Buffers are allocated only when necessary, with a default size of [8K](http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers) bytes. After processing a request, if the connection transitions into the keep-alive state, these buffers are released.


### `APICAST_CACHE_STATUS_CODES`

Expand Down
2 changes: 2 additions & 0 deletions gateway/src/apicast/cli/environment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ _M.default_environment = 'production'
-- @tfield ?string opentelemetry_config_file opentelemetry config file to load
-- @tfield ?string upstream_retry_cases error cases where the call to the upstream should be retried
-- follows the same format as https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream
-- @tfield ?string large_client_header_buffers sets the maximum number and size of buffers used for reading large client request header
-- @tfield ?policy_chain policy_chain @{policy_chain} instance
-- @tfield ?{string,...} nameservers list of nameservers
-- @tfield ?string package.path path to load Lua files
Expand All @@ -149,6 +150,7 @@ _M.default_config = {
opentelemetry_config_file = env_value_ref('OPENTELEMETRY_CONFIG'),
upstream_retry_cases = env_value_ref('APICAST_UPSTREAM_RETRY_CASES'),
http_keepalive_timeout = env_value_ref('HTTP_KEEPALIVE_TIMEOUT'),
large_client_header_buffers = env_value_ref('LARGE_CLIENT_HEADER_BUFFERS'),
policy_chain = require('apicast.policy_chain').default(),
nameservers = parse_nameservers(),
worker_processes = cpus() or 'auto',
Expand Down