diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index b2fa0691..5d83b9f5 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -257,7 +257,7 @@ RUN set -ex; \ # a loaded host that spawn latency can push Apache past its FastCGI timeout and # produce a 502. 300 s (5 min) keeps a warm pool through normal sync-client # polling cycles while still reclaiming memory during genuinely idle periods. - sed -i 's/^;*pm.process_idle_timeout.*/pm.process_idle_timeout = 300s/' /usr/local/etc/php-fpm.d/www.conf; \ + sed -i 's/^;*pm.process_idle_timeout\s*=.*/pm.process_idle_timeout = 300s/' /usr/local/etc/php-fpm.d/www.conf; \ sed -i 's|access.log = /proc/self/fd/2|access.log = /proc/self/fd/1|' /usr/local/etc/php-fpm.d/docker.conf; \ \ echo "[ -n \"\$TERM\" ] && [ -f /root.motd ] && cat /root.motd" >> /root/.bashrc; \ diff --git a/reverse-proxy.md b/reverse-proxy.md index d12e56ab..efca9eaf 100644 --- a/reverse-proxy.md +++ b/reverse-proxy.md @@ -1246,7 +1246,7 @@ A **502 Bad Gateway** response from your reverse proxy means the proxy successfu 1. **Reverse proxy read timeout too short** — The nginx default `proxy_read_timeout` is only 60 seconds. Long-running operations (large file uploads, remote storage scans, etc.) can exceed this limit, causing nginx to close the connection and show 502 (or 504) to the client. Make sure your reverse proxy timeout is set higher than AIO's `NEXTCLOUD_MAX_TIME` (default 3600 s). The sample configs in this document already set `proxy_read_timeout 3610s` for nginx and equivalent values for other proxies. -2. **PHP-FPM worker pool exhausted** — Each PHP request is served by a PHP-FPM worker. Workers are spawned on demand and terminated after 5 minutes of idle time. If a burst of concurrent requests arrives and no workers are available (e.g. all current workers are busy with long operations), Apache returns 502 to Caddy, which returns it to your proxy. Check worker usage with: +2. **PHP-FPM worker pool exhausted** — Each PHP request is served by a PHP-FPM worker. Workers are spawned on demand and terminated after a configurable idle timeout (`pm.process_idle_timeout`). If a burst of concurrent requests arrives and no workers are available (e.g. all current workers are busy with long operations), Apache returns 502 to Caddy, which returns it to your proxy. Check worker usage with: ``` sudo docker exec nextcloud-aio-nextcloud php-fpm -t && \ sudo docker exec nextcloud-aio-nextcloud ps aux | grep php-fpm | wc -l