Files
nextcloud/Containers/apache/nextcloud.conf
T
copilot-swe-agent[bot] 452567ed43 fix(Apache): disable mod_reqtimeout body rate limit to allow slow uploads
Fixes #8457 — large file uploads on slow connections were being
terminated by Apache's mod_reqtimeout MinRate=500 default for
request bodies. This adds an explicit RequestReadTimeout directive
that disables the body rate limit (body=0) while keeping the header
timeout for slowloris protection. The existing Timeout directive
(set to APACHE_MAX_TIME / NEXTCLOUD_MAX_TIME) remains as the
effective I/O timeout.

Also ensures mod_reqtimeout is explicitly loaded in the Dockerfile.

Assisted-by: GitHub Copilot:claude-sonnet-4
2026-07-31 08:44:38 +00:00

62 lines
2.1 KiB
Plaintext

Listen 8000
<VirtualHost *:8000>
ServerName localhost
# Add error log
CustomLog /proc/self/fd/1 proxy
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy
ErrorLog /proc/self/fd/2
ErrorLogFormat "[%t] [%l] [%E] [client: %{X-Forwarded-For}i] [%M] [%{User-Agent}i]"
LogLevel ${AIO_LOG_LEVEL}
# PHP match
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://${NEXTCLOUD_HOST}:9000"
</FilesMatch>
<Proxy "fcgi://${NEXTCLOUD_HOST}:9000" flushpackets=on>
</Proxy>
# Compress JS, CSS and SVG responses with Brotli.
# Other plain-text files are already compressed by Nextcloud itself.
# Desktop and mobile sync clients never request JS/CSS/SVG assets.
<IfModule mod_brotli.c>
AddOutputFilterByType BROTLI_COMPRESS text/javascript application/javascript application/x-javascript text/css image/svg+xml
BrotliCompressionQuality 0
</IfModule>
# Nextcloud dir
DocumentRoot /var/www/html/
<Directory /var/www/html/>
Options FollowSymLinks MultiViews
Require all granted
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
</Directory>
# Deny access to .ht files
<Files ".ht*">
Require all denied
</Files>
# See https://httpd.apache.org/docs/current/en/mod/core.html#limitrequestbody
LimitRequestBody ${APACHE_MAX_SIZE}
# See https://httpd.apache.org/docs/current/mod/core.html#timeout
Timeout ${APACHE_MAX_TIME}
# See https://httpd.apache.org/docs/current/mod/mod_proxy.html#proxytimeout
ProxyTimeout ${APACHE_MAX_TIME}
# See https://httpd.apache.org/docs/current/mod/mod_reqtimeout.html
# Disable body rate limit so that large uploads on slow connections are not aborted.
# The Timeout directive above still applies as the overall I/O timeout.
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=0
</IfModule>
# See https://httpd.apache.org/docs/trunk/mod/core.html#traceenable
TraceEnable Off
</VirtualHost>