summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-08-06 15:49:36 +0200
committerPatrick Spek <p.spek@tyil.nl>2024-08-06 15:50:44 +0200
commit5e833aae984558767d1c47e40ded9c84e61fb1d5 (patch)
tree30a4ff9c9f3fe1fcc963dfa8eb7c1c20a2e119e9
parent11fb0e4a54cea58ec6ff000a19f21e6dd31f1d1e (diff)
downloadproxy-http-5e833aae984558767d1c47e40ded9c84e61fb1d5.tar.gz
proxy-http-5e833aae984558767d1c47e40ded9c84e61fb1d5.tar.bz2
Add variable to set max body size for incoming requests
-rw-r--r--entrypoint.sh1
-rw-r--r--nginx.conf2
2 files changed, 3 insertions, 0 deletions
diff --git a/entrypoint.sh b/entrypoint.sh
index 2c4eea7..62cd300 100644
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -6,6 +6,7 @@ sed \
-e "s/%%PROXY_DESTINATION_HOST%%/${PROXY_DESTINATION_HOST:?}/" \
-e "s/%%PROXY_DESTINATION_PORT%%/${PROXY_DESTINATION_PORT:-80}/" \
-e "s/%%PROXY_DESTINATION_PROTOCOL%%/${PROXY_DESTINATION_PROTOCOL:-http}/" \
+ -e "s/%%PROXY_REQUEST_SIZE_MAX%%/${PROXY_REQUEST_SIZE_MAX:-1m}/" \
< /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
exec nginx -g "daemon off;"
diff --git a/nginx.conf b/nginx.conf
index 997a0bf..cce1462 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -16,6 +16,8 @@ http {
'' close;
}
+ client_max_body_size "%%PROXY_REQUEST_SIZE_MAX%%";
+
server {
listen %%PROXY_LISTEN_PORT%% default_server;
listen [::]:%%PROXY_LISTEN_PORT%% default_server;