Issues After Hestia CP Update – From 400 Bad Request to 500 Internal Server Error

Hello everyone,

I’ve just upgraded my Hestia Control Panel using:

sudo apt update && sudo apt upgrade

Immediately afterward, every site on the server began failing with:

400 Bad Request
Request Header Or Cookie Too Large

In an attempt to resolve it, I edited my Nginx configuration:

sudo nano /etc/nginx/nginx.conf

Added the following inside the http { … } block:

client_header_buffer_size   4k;
large_client_header_buffers 4 16k;

I then tested and reloaded Nginx:

sudo nginx -t
sudo systemctl reload nginx

However, now all of my WordPress sites are returning:

Internal Server Error
Oops! Something went wrong.

The server encountered an internal error or misconfiguration and was unable to complete your request.

Error Code: 500

I’m at a loss as to what to try next. Every site on this server is affected, and they all run WordPress. Any advice on how to restore functionality would be greatly appreciated.

sudo tail -n 50 /var/log/nginx/error.log just:
025/07/21 20:46:31 [warn] 219546#219546: "ssl_stapling" ignored, no OCSP responder URL in the certificate issues

sudo tail -n 50 /var/log/nginx/domains/domain.de.error.log
sudo tail -n 50 /var/log/nginx/domains/domain.de.error.log

sudo tail -n 50 /var/log/nginx/domains/domain.de.error.log
2025/07/20 17:14:59 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/themes/admin.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:00 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/css/wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:00 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/Text/Diff/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:01 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/block-supports/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:01 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/chosen.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:02 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/themes/file.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:02 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/fonts/admin.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:03 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/classwithtostring.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:03 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/upgrade/admin.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:04 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/log.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:05 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/js/wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:05 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/themes/twentytwentytwo/alfa-rex.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:06 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/style-engine/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:06 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/Text/wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:07 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/languages/chosen.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:07 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/network/chosen.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:08 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/html-api/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:08 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/plugins/linkpreview/db.php?u HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:10 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/chosen.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:10 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/js/wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:11 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/block-supports/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:11 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/plugins/wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:12 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/js/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:12 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/upgrade/admin.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:13 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/themes/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:14 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/upgrade/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:14 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/IXR/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:15 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/fonts/admin.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:15 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/function.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:16 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/Text/wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:17 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/languages/chosen.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:17 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/html-api/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:18 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/log.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:19 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/js/codemirror/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:19 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/SimplePie/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:20 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/block-patterns/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:20 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /.well-known/pki-validation/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:21 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/classwithtostring.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:22 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/Text/Diff/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:23 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-conflg.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:24 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/plugins/wp-help/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:24 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-admin/includes/xmrlpc.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:27 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/cong.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:27 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/style-engine/index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:28 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-includes/Text/Diff/Engine/about.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/20 17:15:29 [error] 1613#1613: *1480 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 4.197.236.174, server: domain.de, request: "GET /wp-content/plugins/hellopress/wp_filemanager.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php8.3-fpm-domain.de.sock:", host: "domain.de"
2025/07/21 21:14:20 [error] 4882#4882: *11416 peer closed connection in SSL handshake while SSL handshaking to upstream, client: SERVERIP, server: domain.de, request: "GET / HTTP/1.0", upstream: "https://SERVERIP:443/", host: "domain.de"
2025/07/21 21:14:20 [error] 4881#4881: *9998 upstream sent too big header while reading response header from upstream, client: SERVERIP, server: domain.de, request: "GET / HTTP/1.0", upstream: "https://SERVERIP:443/", host: "domain.de"
2025/07/21 21:14:21 [error] 4882#4882: *13455 peer closed connection in SSL handshake while SSL handshaking to upstream, client: SERVERIP, server: domain.de, request: "GET /favicon.ico HTTP/1.0", upstream: "https://SERVERIP:443/favicon.ico", host: "domain.de", referrer: "https://domain.de/"
2025/07/21 21:14:21 [error] 4881#4881: *12037 upstream sent too big header while reading response header from upstream, client: SERVERIP, server: domain.de, request: "GET /favicon.ico HTTP/1.0", upstream: "https://SERVERIP:443/favicon.ico", host: "domain.de", referrer: "https://domain.de/"

Hi @eXe

Did you migrate your installation from Nginx+Apache to Nginx?

yes, few weeks ago

im not able to to that again:

./migrate_ngnix_apache_nginx-php-fpm.sh
/usr/local/hestia/func/main.sh: line 175: [: too many arguments

Backup all your sites, conf, or if you can, better create a snapshot of your server.

Then try to execute again the migration script but this time we need to modify it a bit:

First, modify /etc/nginx/nginx.conf and restore the original values for large_client_header_buffers

large_client_header_buffers     4 8k;

And restart nginx:

systemctl restart nginx

Now modify the migration script and run it again.

cd /usr/local/hestia/install/upgrade/manual/
cp migrate_ngnix_apache_nginx-php-fpm.sh migrate_ngnix_apache_nginx-php-fpm.sh.ori
sed -i '22,30 s/^/#/' migrate_ngnix_apache_nginx-php-fpm.sh
./migrate_ngnix_apache_nginx-php-fpm.sh

Then, check if the issue is resolved.

3 Likes

You are really impressive. I know I’ve said this before but it’s always amazing how well you know your stuff, how precise your answers are and how much passion and work you put into it! I am happy to support you financially and am glad to have heard about you.

That goes for the whole team! Thank you very much

5 Likes

I really appreciate your kind words :heart_eyes:

So, that fixed the issue? :wink:

2 Likes

True! Resolved :heart_eyes:

3 Likes

hello, I’ve faced the similar issue whilst my websites have migrated from nginx+apache to nginx
however, previous updates hasn’t overwritten my /usr/local/hestia/conf/hestia.conf

could you please clarify what was the issue with 1.9.4 update and nginx+apache => nginx only websites? was the /usr/local/hestia/conf/hestia.conf mistakenly overwritten?
if i remember correctly, changes while updating were made to hestia.conf.new, not to hestia.conf directly.

i was wondering if you could define the root case

many thanks