400 Bad Request after update v1.8.11 to v1.8.12

400 Bad Request
Request Header Or Cookie Too Large

After upgrading from v1.8.11 to v1.8.12, some of my sites started to show this error.
Nginx only.
image

[400 Bad Request ngiNX v1.8.10](400 Bad Request ngiNX v1.8.10)

I followed this thread, but there are no lines

PROXY_PORT=‘80’
PROXY_SSL_PORT=‘443’
PROXY_SYSTEM=‘nginx’

in the file /usr/local/hestia/conf/defaults/hestia.conf

I moved from apache + nginx to just nginx in the past, how do I undo it or add apache back?

1 Like

If you clean your browser’s cache it should allow yo to view your sites.

Did you modify large_client_header_buffers directive?

1 Like

I have already cleared the cache, tested on other browsers and devices, it doesn’t work either.

No, I have not modified this directive.

Then edit /etc/nginx/nginx.conf file and modify this directive:

large_client_header_buffers     4 8k;

by

large_client_header_buffers     4 16k;

Execute nginx -t and if no error, restart nginx:

systemctl restart nginx

If that doesn’t work, instead of 16K you could change it to 32k, also, in the same file you could change client_header_buffer_size 2k; to something like client_header_buffer_size 8k;

1 Like

Make the following changes

offtopic, but how do you determine what the size should be?

I am experiencing the same issue. After modifying the following line in the nginx.conf file:

large_client_header_buffers 4 16k;

I received an Internal Server Error.

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

Error Code: 500

Additionally, when executing the following command:

an error occurred:

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

If there is a quick fix available to help resolve this issue when working with full nginx, it would be greatly appreciated

PS: I am using HestiaCP with full Nginx and the Laravel template

Now the error has changed to 500, as @atefbn said.

This script has the comment
# Manual upgrade script from Nginx + Apache2 + PHP-FPM to Nginx + PHP-FPM
And I would like to upgrade from Nginx + PHP-FPM to Nginx + Apache2 + PHP-FPM

And what the nginx log says?

/var/log/nginx/domains/[hide].net.error.log

2024/08/26 15:26:03 [alert] 30196#30196: *18214 1024 worker_connections are not enough while connecting to upstream, client: [hide].0.146, server: [hide].net, request: "GET / HTTP/1.0", upstream: "https://[hide].0.146:443/", host: "[hide].net"
  • I changed domain and ip to [hide] for security

You can raise worker connections, something like this:

From:

worker_connections 1024;

To:

worker_connections 2048;

Restart nginx and try again.

But I didn’t make any changes to the server, this happened after the update (and it was updated automatically).
Webmail is also not working.

I understand your concern but I’m trying to help based on the info we get. Also, keep in mind that there are no changes on main nginx conf but your sites have been rebuilt during the upgrade, don’t know if that modified something to your sites.

Raising workers didn’t help?

I really appreciate your help!

I changed the worker_connections, and then the error went back to 400 Bad Request Request Header Or Cookie Too Large.
So I changed the large_client_header_buffers again, but now to 32k and the 500 error came back.

I don’t think it’s my application, I also checked and it didn’t have any changes, like the Webmail that uses Roundcube, it issues the same error. Any other suggestions?

As in the other topic, it seems that this error happens when HestiaCP is updated and for those who have already migrated from Apache + Nginx to Nginx only, I don’t know if it’s related.

remove from migrate_ngnix_apache_nginx-php-fpm.sh


#----------------------------------------------------------#
#                    Verifications                         #
#----------------------------------------------------------#

if [ "$WEB_BACKEND" != "php-fpm" ]; then
	check_result $E_NOTEXISTS "PHP-FPM is not enabled" > /dev/null
	exit 1
fi

if [ "$WEB_SYSTEM" != "apache2" ]; then
	check_result $E_NOTEXISTS "Apache2 is not enabled" > /dev/null
	exit 1
fi

launch ./migrate_ngnix_apache_nginx-php-fpm.sh

It helped me. :cowboy_hat_face:

4 Likes

That worked for me, thank you!!

I’m getting:

nginx: [emerg] open() “/etc/nginx/conf.d/domains/webmail.mydomain.com.ssl.conf” failed (2: No such file or directory) in /etc/nginx/nginx.conf

Before i got this:
nginx: [emerg] the shared memory zone “mydomain.com” is already declared for a different use in /etc/nginx/conf.d/fastcgi_cache_pool.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

also nginx dissapeared from service overview in backend. after changing nginx conf file.

Edit: after adding WEB_SSL_PORT=‘443’ and WEB_SERVER=‘nginx’ to hestia.conf, nginx is active as webserver again.

Im pretty sure it was due to me migrating from apache2+phpfpm to nginx+phpfpm a month ago. This morning only one domain failed and it was due to nginx proxy cache still active on the domain (before i restarted nginx and it failed). After disabling proxy cache nginx started again.

So it seems i made a mess after i deleted the cache folder contents.

Really need these domains active asap

nginx: [emerg] open() “/etc/nginx/conf.d/domains/webmail.myserver.nl.ssl.conf” failed (2: No such file or directory) in /etc/nginx/nginx.conf:130

WARNING: Tue Aug 27 10:00:36 2024 → Clamd was NOT notified: Can’t connect to clamd through /run/clamav/clamd.ctl: No such file or directory

/usr/local/hestia/install/upgrade/manual/migrate_ngnix_apache_nginx-php-fpm.sh
/usr/local/hestia/func/main.sh: line 151: [: too many arguments

error.log

2024-08-27 09:16:05 v-rebuild-all [Error 1]
2024-08-27 09:16:11 v-rebuild-web-domains ‘main’ ‘’ [Error 11]
2024-08-27 09:47:37 v-restart-service ‘nginx’ ‘yes’ [Error 20]
2024-08-27 09:49:01 v-restart-service ‘nginx’ ‘yes’ [Error 20]

nginx error log:
2024/08/27 07:47:49 [error] 3935321#0: *54 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined variable $v_user in /usr/local/hestia/web/fm/configuration.php on line 78; PHP message: PHP Warning: Und>
Stack trace:
#0 /usr/local/hestia/web/fm/backend/Services/Auth/Adapters/HestiaAuth.php(55): Hestiacp\quoteshellarg\quoteshellarg()
#1 /usr/local/hestia/web/fm/backend/Services/Router/Router.php(33): Filegator\Services\Auth\Adapters\HestiaAuth->user()
#2 /usr/local/hestia/web/fm/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php(143): Filegator\Services\Router\Router->__construct()
#3 /usr/local/hestia/web/fm/vendor/php-di/php-di/src/Definition/Resolver/ObjectCreator.php(71): DI\Definition\Resolver\ObjectCreator->createInstance()
#4 /usr/

I’m having issues with the webmail too:

400 Bad Request

Request Header Or Cookie Too Large

This fix has fixed only the sites (and requested me to manually set again the Nginx template for each single site). Is there a quick fix for the webmail?