Commit 5497f719 authored by Michael Killough's avatar Michael Killough
Browse files

Allow client_body_buffer_size to be overriden.

This change allows `client_body_buffer_size` to be overriden by users of
the sidecar. It defaults the environment variable to 8k, which is what
nginx sets it to on x86-64.

We're regularly seeing larger requests get written to disk on some of
our services. This will allow us to configure a larger buffer size to
avoid this.

In the future, we may want to change the default 8k size to something
larger.
parent 7479e100
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
0.2.2
0.3.0
+1 −0
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ http {
  server {
    listen <NGINX_PORT> deferred;

    client_body_buffer_size <CLIENT_BODY_BUFFER_SIZE>;
    client_max_body_size 5M; # default 1M

    location / {
+5 −1
Original line number Diff line number Diff line
@@ -4,7 +4,11 @@ set -ex

# nginx.conf doesn't support environment variables,
# so we substitute at run time
/bin/sed -e "s/<NGINX_PORT>/${NGINX_PORT}/g" -e "s/<APP_PORT>/${APP_PORT}/g" /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
/bin/sed \
  -e "s/<NGINX_PORT>/${NGINX_PORT}/g" \
  -e "s/<APP_PORT>/${APP_PORT}/g" \
  -e "s/<CLIENT_BODY_BUFFER_SIZE>/${CLIENT_BODY_BUFFER_SIZE:-8k}/g" \
  /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf

# Wait for the application to start before accepting ALB requests.
while sleep 2; do