-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat(conf) configurable request body handling #2602
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,9 @@ local CONF_INFERENCES = { | |
latency_tokens = {typ = "boolean"}, | ||
error_default_type = {enum = {"application/json", "application/xml", | ||
"text/html", "text/plain"}}, | ||
client_max_body_size = {typ = "string"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we are missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is indeed for explicitness. All There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
client_body_buffer_size = {typ = "string"}, | ||
|
||
|
||
database = {enum = {"postgres", "cassandra"}}, | ||
pg_port = {typ = "number"}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ error_log ${{PROXY_ERROR_LOG}} ${{LOG_LEVEL}}; | |
>-- reset_timedout_connection on; # disabled until benchmarked | ||
> end | ||
|
||
client_max_body_size 0; | ||
client_max_body_size ${{CLIENT_MAX_BODY_SIZE}}; | ||
proxy_ssl_server_name on; | ||
underscores_in_headers on; | ||
|
||
|
@@ -84,6 +84,7 @@ server { | |
access_log ${{PROXY_ACCESS_LOG}}; | ||
error_log ${{PROXY_ERROR_LOG}} ${{LOG_LEVEL}}; | ||
|
||
client_body_buffer_size ${{CLIENT_BODY_BUFFER_SIZE}}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should also add them to the fixture Nginx template in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the fixtures/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done-er :) |
||
|
||
> if ssl then | ||
listen ${{PROXY_LISTEN_SSL}} ssl; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Nginx default is
1m
. In the past, we've always respected Nginx's defaults when introducing new config variables that are just wrapping underplaying Nginx directives. Any reason for not doing so for this - sensitive - setting?Additionally, when a config value is a 1-to-1 mapping of an Nginx directive, we also mention it in the description (controls the Nginx core module directive bearing the same name), and we include a note below with the link to the Nginx documentation (which is especially useful because it mentions size units like
k
andm
that these directive use).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the Nginx default (
1m
) would be a breaking change, as we already define this as0
in our template, hence the use of 0 here- my initial thought was to set it at1m
, but this breaks tests and a number of expected behaviors. Would be happy to set this to1m
in a separate change targetting 0.11 in a separate PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, we have this hard-coded right now... We should probably introduce that change in 0.11 indeed.
0
is a dangerous default here, and contrary to our "least trust" policy introduced with 0.11 for saner/safer defaults.