2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-09 14:50:58 +00:00

feat: make client_max_body_size configurable via env (#1029)

This commit is contained in:
Bernhard Sirlinger 2022-12-26 22:42:22 +01:00 committed by GitHub
parent 75e44ba902
commit 8f7b234a12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 1 deletions

View File

@ -36,6 +36,7 @@ services:
UPSTREAM_REAL_IP_HEADER: ${UPSTREAM_REAL_IP_HEADER:-X-Forwarded-For}
UPSTREAM_REAL_IP_RECURSIVE: ${UPSTREAM_REAL_IP_RECURSIVE:-off}
PROXY_READ_TIMOUT: ${PROXY_READ_TIMOUT:-120}
CLIENT_MAX_BODY_SIZE: ${CLIENT_MAX_BODY_SIZE:-50m}
volumes:
- sites:/usr/share/nginx/html/sites
- assets:/usr/share/nginx/html/assets

View File

@ -42,3 +42,7 @@ UPSTREAM_REAL_IP_RECURSIVE=
# All Values Allowed by nginx proxy_read_timeout are allowed, default value is 120s
# Useful if you have longrunning print formats or slow loading sites
PROXY_READ_TIMOUT=
# All Values allowed by nginx client_max_body_size are allowed, default value is 50m
# Necessary if the upload limit in the frappe application is increased
CLIENT_MAX_BODY_SIZE=

View File

@ -44,6 +44,7 @@ FROM nginxinc/nginx-unprivileged:1.23.3-alpine as frappe
# Set default ENV variables for backwards compatibility
ENV PROXY_READ_TIMOUT=120
ENV CLIENT_MAX_BODY_SIZE=50m
# https://github.com/nginxinc/docker-nginx-unprivileged/blob/main/stable/alpine/20-envsubst-on-templates.sh
COPY nginx-template.conf /etc/nginx/templates/default.conf.template

View File

@ -87,7 +87,7 @@ server {
# optimizations
sendfile on;
keepalive_timeout 15;
client_max_body_size 50m;
client_max_body_size ${CLIENT_MAX_BODY_SIZE};
client_body_buffer_size 16K;
client_header_buffer_size 1k;

View File

@ -88,6 +88,7 @@ services:
UPSTREAM_REAL_IP_HEADER: X-Forwarded-For
UPSTREAM_REAL_IP_RECURSIVE: "off"
PROXY_READ_TIMOUT: 120
CLIENT_MAX_BODY_SIZE: 50m
volumes:
- sites:/usr/share/nginx/html/sites
- assets:/usr/share/nginx/html/assets