From 4048acf60e21848524067f90802e44e43e3101df Mon Sep 17 00:00:00 2001 From: DDSRem <73049927+DDSRem@users.noreply.github.com> Date: Sat, 16 Nov 2024 10:23:28 +0800 Subject: [PATCH] feat(docker): nginx `client_max_body_size` configuration fix https://github.com/jxxghp/MoviePilot/issues/2951 fix https://github.com/jxxghp/MoviePilot/issues/2720 --- entrypoint | 3 ++- nginx.conf | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypoint b/entrypoint index cd0623228..7b70d970f 100644 --- a/entrypoint +++ b/entrypoint @@ -3,7 +3,8 @@ # shellcheck disable=SC2016 # 使用 `envsubst` 将模板文件中的 ${NGINX_PORT} 替换为实际的环境变量值 -envsubst '${NGINX_PORT}${PORT}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf +NGINX_CLIENT_MAX_BODY_SIZE=${NGINX_CLIENT_MAX_BODY_SIZE:-10m} +envsubst '${NGINX_PORT}${PORT}${NGINX_CLIENT_MAX_BODY_SIZE}' < /etc/nginx/nginx.template.conf > /etc/nginx/nginx.conf # 自动更新 cd / /usr/local/bin/mp_update diff --git a/nginx.conf b/nginx.conf index 93d0436ce..99158f846 100644 --- a/nginx.conf +++ b/nginx.conf @@ -17,6 +17,8 @@ http { keepalive_timeout 3600; + client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE}; + gzip on; gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; gzip_proxied any;