Hi ,
I am facing a persistent issue on a HestiaCP (Nginx Standalone + PHP-FPM) setup when trying to connect the official Bunny.net WordPress plugin.
The Scenario: The plugin attempts to link the account via a GET request containing a very long API Key in the URL parameter.
The Problem:
-
Default Configuration: Nginx throws an Error 500. The error log shows:
upstream sent too big header while reading response header from upstream, request: "GET /wp-admin/admin.php?page=bunnycdn&apiKey=xxxxxxxx..." -
Attempted Fix: I tried to increase the FastCGI buffers in the Nginx configuration (both in
nginx.confdirectly and via custom Web Templates). I added the following directive inside the PHP location block:Nginx
location ~ [^/]\.php(/|$) { ... fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; ... } -
The Result: As soon as I increase the buffers to fix the Error 500, the server immediately throws an Error 502 Bad Gateway.
-
I have tried “middle ground” values (64k/128k). Result: 502.
-
I have tried increasing timeouts (
fastcgi_read_timeout 300, etc). Result: 502. -
I verified that the PHP-FPM service (tested on PHP 8.2, 8.3, and 8.4) is running.
-
The
php-fpm.logdoes not show any crash or specific error when the 502 happens. -
If I revert the buffers to default, the 502 disappears, and the Error 500 (headers too big) returns.
-
Environment:
-
HestiaCP Version: (Latest)
-
OS: Ubuntu
-
Web Server: Nginx only (No Apache)
-
PHP-FPM: Tested on 8.2, 8.3, 8.4.
It seems like increasing the buffers causes PHP-FPM to hang or Nginx to fail the handshake immediately.
Does anyone know the correct buffer configuration for HestiaCP Nginx templates to handle large headers without causing a 502?
Thanks in advance.