From 441cd4d868bb8006f31a4e311b3e5d79fb43196f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Lewczy=C5=84ski?= Date: Mon, 15 May 2017 14:25:33 +0200 Subject: [PATCH] Set client_max_body_size property Also the property is read from the .env file and if it does not contain a value the `1m` default value will be used. --- README.md | 3 +++ nginx.conf | 1 + run.sh | 1 + 3 files changed, 5 insertions(+) diff --git a/README.md b/README.md index fdd0b9d..1b85af4 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,9 @@ The directory to store Nginx log files. It defaults to `/var/log/nginx`. ##### `CONSUL_TEMPLATE_LOG_DIR` The directory to store Consul Template log files. It defaults to `/var/log/consul-template`. +##### `CLIENT_MAX_BODY_SIZE` +Sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field. It defaults to `1m`. + ## Volumes diff --git a/nginx.conf b/nginx.conf index 61cef5b..c9d48b4 100644 --- a/nginx.conf +++ b/nginx.conf @@ -25,6 +25,7 @@ server { access_log {{ env "NGINX_LOG_DIR" }}/access.log upstream_time; error_log {{ env "NGINX_LOG_DIR" }}/error.log; server_name {{ env "VIRTUAL_HOST" }}; + client_max_body_size {{ env "CLIENT_MAX_BODY_SIZE" }}; {{ $paramRegex := "{[\\w-]+}" }} {{ $allRegex := "<[\\w-]+>" }} diff --git a/run.sh b/run.sh index e46941e..a5e982a 100755 --- a/run.sh +++ b/run.sh @@ -13,6 +13,7 @@ export SERVICE_TAG="${SERVICE_TAG:-openlmis-service}" export RESOURCES_PATH="${RESOURCES_PATH:-resources}" export NGINX_LOG_DIR="${NGINX_LOG_DIR:-/var/log/nginx}" export CONSUL_TEMPLATE_LOG_DIR="${CONSUL_TEMPLATE_LOG_DIR:-/var/log/consul-template}" +export CLIENT_MAX_BODY_SIZE="${CLIENT_MAX_BODY_SIZE:-1m}" # Run consul-template in background CONSUL_PATH="${CONSUL_HOST}:${CONSUL_PORT}"