mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Document the proxy_header protocol option
This commit is contained in:
parent
f9d689f9fd
commit
ef05956a5a
2 changed files with 55 additions and 23 deletions
|
@ -31,6 +31,7 @@ opts() :: #{
|
||||||
max_request_line_length => non_neg_integer(),
|
max_request_line_length => non_neg_integer(),
|
||||||
max_skip_body_length => non_neg_integer(),
|
max_skip_body_length => non_neg_integer(),
|
||||||
middlewares => [module()],
|
middlewares => [module()],
|
||||||
|
proxy_header => boolean(),
|
||||||
request_timeout => timeout(),
|
request_timeout => timeout(),
|
||||||
sendfile => boolean(),
|
sendfile => boolean(),
|
||||||
shutdown_timeout => timeout(),
|
shutdown_timeout => timeout(),
|
||||||
|
@ -50,63 +51,87 @@ Ranch functions `ranch:get_protocol_options/1` and
|
||||||
The default value is given next to the option name:
|
The default value is given next to the option name:
|
||||||
|
|
||||||
connection_type (supervisor)::
|
connection_type (supervisor)::
|
||||||
Whether the connection process also acts as a supervisor.
|
|
||||||
|
Whether the connection process also acts as a supervisor.
|
||||||
|
|
||||||
env (#{})::
|
env (#{})::
|
||||||
Middleware environment.
|
|
||||||
|
Middleware environment.
|
||||||
|
|
||||||
idle_timeout (60000)::
|
idle_timeout (60000)::
|
||||||
Time in ms with no data received before Cowboy closes the connection.
|
|
||||||
|
Time in ms with no data received before Cowboy closes the connection.
|
||||||
|
|
||||||
inactivity_timeout (300000)::
|
inactivity_timeout (300000)::
|
||||||
Time in ms with nothing received at all before Cowboy closes the connection.
|
|
||||||
|
Time in ms with nothing received at all before Cowboy closes the connection.
|
||||||
|
|
||||||
linger_timeout (1000)::
|
linger_timeout (1000)::
|
||||||
Time in ms that Cowboy will wait when closing the connection. This is
|
|
||||||
necessary to avoid the TCP reset problem as described in the
|
Time in ms that Cowboy will wait when closing the connection. This is
|
||||||
https://tools.ietf.org/html/rfc7230#section-6.6[section 6.6 of RFC7230].
|
necessary to avoid the TCP reset problem as described in the
|
||||||
|
https://tools.ietf.org/html/rfc7230#section-6.6[section 6.6 of RFC7230].
|
||||||
|
|
||||||
max_empty_lines (5)::
|
max_empty_lines (5)::
|
||||||
Maximum number of empty lines before a request.
|
|
||||||
|
Maximum number of empty lines before a request.
|
||||||
|
|
||||||
max_header_name_length (64)::
|
max_header_name_length (64)::
|
||||||
Maximum length of header names.
|
|
||||||
|
Maximum length of header names.
|
||||||
|
|
||||||
max_header_value_length (4096)::
|
max_header_value_length (4096)::
|
||||||
Maximum length of header values.
|
|
||||||
|
Maximum length of header values.
|
||||||
|
|
||||||
max_headers (100)::
|
max_headers (100)::
|
||||||
Maximum number of headers allowed per request.
|
|
||||||
|
Maximum number of headers allowed per request.
|
||||||
|
|
||||||
max_keepalive (100)::
|
max_keepalive (100)::
|
||||||
Maximum number of requests allowed per connection.
|
|
||||||
|
Maximum number of requests allowed per connection.
|
||||||
|
|
||||||
max_method_length (32)::
|
max_method_length (32)::
|
||||||
Maximum length of the method.
|
|
||||||
|
Maximum length of the method.
|
||||||
|
|
||||||
max_request_line_length (8000)::
|
max_request_line_length (8000)::
|
||||||
Maximum length of the request line.
|
|
||||||
|
Maximum length of the request line.
|
||||||
|
|
||||||
max_skip_body_length (1000000)::
|
max_skip_body_length (1000000)::
|
||||||
Maximum length Cowboy is willing to skip when the user code did not read the body fully.
|
|
||||||
When the remaining length is too large or unknown Cowboy will close the connection.
|
Maximum length Cowboy is willing to skip when the user code did not read the body fully.
|
||||||
|
When the remaining length is too large or unknown Cowboy will close the connection.
|
||||||
|
|
||||||
middlewares ([cowboy_router, cowboy_handler])::
|
middlewares ([cowboy_router, cowboy_handler])::
|
||||||
Middlewares to run for every request.
|
|
||||||
|
Middlewares to run for every request.
|
||||||
|
|
||||||
|
proxy_header (false)::
|
||||||
|
|
||||||
|
Whether incoming connections have a PROXY protocol header. The
|
||||||
|
proxy information will be passed forward via the `proxy_header`
|
||||||
|
key of the Req object.
|
||||||
|
|
||||||
request_timeout (5000)::
|
request_timeout (5000)::
|
||||||
Time in ms with no requests before Cowboy closes the connection.
|
|
||||||
|
Time in ms with no requests before Cowboy closes the connection.
|
||||||
|
|
||||||
sendfile (true)::
|
sendfile (true)::
|
||||||
Whether the sendfile syscall may be used. It can be useful to disable
|
|
||||||
it on systems where the syscall has a buggy implementation, for example
|
Whether the sendfile syscall may be used. It can be useful to disable
|
||||||
under VirtualBox when using shared folders.
|
it on systems where the syscall has a buggy implementation, for example
|
||||||
|
under VirtualBox when using shared folders.
|
||||||
|
|
||||||
shutdown_timeout (5000)::
|
shutdown_timeout (5000)::
|
||||||
Time in ms Cowboy will wait for child processes to shut down before killing them.
|
|
||||||
|
Time in ms Cowboy will wait for child processes to shut down before killing them.
|
||||||
|
|
||||||
stream_handlers ([cowboy_stream_h])::
|
stream_handlers ([cowboy_stream_h])::
|
||||||
Ordered list of stream handlers that will handle all stream events.
|
|
||||||
|
Ordered list of stream handlers that will handle all stream events.
|
||||||
|
|
||||||
== Changelog
|
== Changelog
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@ opts() :: #{
|
||||||
max_frame_size_sent => 16384..16777215 | infinity,
|
max_frame_size_sent => 16384..16777215 | infinity,
|
||||||
middlewares => [module()],
|
middlewares => [module()],
|
||||||
preface_timeout => timeout(),
|
preface_timeout => timeout(),
|
||||||
|
proxy_header => boolean(),
|
||||||
sendfile => boolean(),
|
sendfile => boolean(),
|
||||||
settings_timeout => timeout(),
|
settings_timeout => timeout(),
|
||||||
shutdown_timeout => timeout(),
|
shutdown_timeout => timeout(),
|
||||||
|
@ -120,6 +121,12 @@ preface_timeout (5000)::
|
||||||
|
|
||||||
Time in ms Cowboy is willing to wait for the connection preface.
|
Time in ms Cowboy is willing to wait for the connection preface.
|
||||||
|
|
||||||
|
proxy_header (false)::
|
||||||
|
|
||||||
|
Whether incoming connections have a PROXY protocol header. The
|
||||||
|
proxy information will be passed forward via the `proxy_header`
|
||||||
|
key of the Req object.
|
||||||
|
|
||||||
sendfile (true)::
|
sendfile (true)::
|
||||||
|
|
||||||
Whether the sendfile syscall may be used. It can be useful to disable
|
Whether the sendfile syscall may be used. It can be useful to disable
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue