allow to disable proxy_buffering

This commit is contained in:
Zoey
2024-02-15 01:18:32 +01:00
parent c07ecc3239
commit c546e853a8
4 changed files with 18 additions and 0 deletions

View File

@@ -124,6 +124,7 @@ ENV PUID=0 \
DISABLE_HTTP=false \
NGINX_ACCESS_LOG=false \
NGINX_LOG_NOT_FOUND=false \
NGINX_DISABLE_PROXY_BUFFERING=false \
CLEAN=true \
FULLCLEAN=false \
SKIP_IP_RANGES=false \

View File

@@ -31,6 +31,7 @@ services:
# - "DEFAULT_CERT_ID=1" # ID of cert, which should be used instead of dummycerts, default 0/unset/dummycerts
# - "DISABLE_HTTP=true" # disables nginx to listen on port 80, default false
# - "NGINX_LOG_NOT_FOUND=true" # Allow logging of 404 errors, default false
# - "NGINX_DISABLE_PROXY_BUFFERING=true" # Disabled the proxy-buffering option of nginx, default false
# - "CLEAN=false" # Clean folders, default true
# - "FULLCLEAN=true" # Clean unused config folders, default false
# - "SKIP_IP_RANGES=true" # Skip feteching/whitelisting ip ranges from aws and cloudflare, default false

View File

@@ -136,6 +136,11 @@ if ! echo "$NGINX_LOG_NOT_FOUND" | grep -q "^true$\|^false$"; then
sleep inf
fi
if ! echo "$NGINX_DISABLE_PROXY_BUFFERING" | grep -q "^true$\|^false$"; then
echo "NGINX_DISABLE_PROXY_BUFFERING needs to be true or false."
sleep inf
fi
if ! echo "$CLEAN" | grep -q "^true$\|^false$"; then
echo "CLEAN needs to be true or false."
sleep inf
@@ -735,6 +740,12 @@ else
sed -i "s|log_not_found.*|log_not_found off;|g" /usr/local/nginx/conf/nginx.conf
fi
if [ "$NGINX_DISABLE_PROXY_BUFFERING" = "true" ]; then
sed -i "s|proxy_buffering.*|proxy_buffering off;|g" /usr/local/nginx/conf/nginx.conf
else
sed -i "s|proxy_buffering.*|proxy_buffering on;|g" /usr/local/nginx/conf/nginx.conf
fi
if [ "$LOGROTATE" = "true" ]; then
sed -i "s|access_log off; # http|access_log /data/nginx/access.log log;|g" /usr/local/nginx/conf/nginx.conf
sed -i "s|access_log off; # stream|access_log /data/nginx/stream.log proxy;|g" /usr/local/nginx/conf/nginx.conf

View File

@@ -43,6 +43,11 @@ http {
gunzip on;
gzip_static on;
proxy_buffering on;
proxy_buffer_size 16k;
proxy_busy_buffers_size 24k;
proxy_buffers 64 4k;
http2 on;
http3 on;
quic_gso on;