From 2bc3c4e7ecc3c8ad341e1f80c0352f9ac5669af7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 27 Apr 2026 15:32:37 +0000 Subject: [PATCH] refine: improve sed pattern specificity and remove hardcoded timeout from docs - Use \s*= in pm.process_idle_timeout sed pattern to match only setting lines, not comment-only lines that mention the setting name - Remove hardcoded '5 minutes' from docs; reference pm.process_idle_timeout by name so it stays accurate if the value changes Agent-Logs-Url: https://github.com/nextcloud/all-in-one/sessions/2fd7a6d1-bfdb-4f26-a8d0-cd54a7307999 Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com> --- Containers/nextcloud/Dockerfile | 2 +- reverse-proxy.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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