You are a life savvier!!!
OMG!!!
Thank you very much.
Merci beaucoup!
Ça marche parfait!
Misdirected Request
The client needs a new connection for this request as the requested host name does not match the Server Name Indication (SNI) in use for this connection.
Already resolved here: Nginx + apache + ssl = 421 misdirected request - #42 by Gintcho
Nginx + apache + ssl = 421 misdirected request - #16 by sahsanu
Suggestion, kindly check the forum prior to raising queries.
For those who don’t understand what to do. I even had to register)))
Open the terminal
Enter the command
for file in $(grep -l proxy_pass /usr/local/hestia/data/templates/web/nginx/*.stpl); do
if ! grep -q proxy_ssl_server_name "$file"; then
sed -i '/proxy_pass/ i\\t\tproxy_ssl_server_name on;\n\t\tproxy_ssl_name $host;' "$file";
fi;
done
for i in $(v-list-users plain | cut -f1); do
echo "Rebuilding web domains for user $i";
v-rebuild-web-domains $i yes;
done
After Enter the command
systemctl restart nginx
systemctl restart apache2
Same issue with Ubuntu 24.04.2 LTS and latest HestiaCP on last system update. Solved too by curl -fsSLm15 https://7j.gg/fixnginx421 | sudo bash -s --
Thank you guys for quick solution. I’ve spend 2 hours trying fix this myself.
Already done few days ago
This one was from today, by someone else. Sahsanu did it already. ![]()
Registered an account just to say THANK YOU for saving my .. bacon .. on this. The script ran cleanly and clearly explained what it was doing. Great work!
I would take a little time to appreciate this community who have helped me everytime my server have been broken. Thanks everyone. The script worked flawlessly and fixed the issue in one go. ![]()
Edit2: If you want, you could use this script to fix the templates and rebuild the domains at once.
curl -fsSLm15 https://7j.gg/fixnginx421 | sudo bash -s --
This fixed my issue. Thanks
will fix the issue swell
@sahsanu @maurice
Hello!
Tried both solutions.
For “echo -e “proxy_ssl_server_name on;\nproxy_ssl_name $host;” > /etc/nginx/conf.d/fixssl.conf && service nginx restart”
i got error " Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."
For scrypt “curl -fsSLm15 https://7j.gg/fixnginx421 | sudo bash -s --”
i got:
Fixing Nginx templates (web and mail) to avoid error 421 after updating Apache2 to version 2.4.64
There is no need to rebuild web domains
There is no need to rebuild mail domains
Done!"
So what should i do?
Check the logs /var/log/apache2/domains/YourDomain.error.log
Also check the services:
systemctl status nginx --no-pager -l
systemctl status apache2 --no-pager -l
Thanks for advice!
i fixed this with restarting docker container
Thank you for the fix.
One question about this issue: Is there a way to stop Apache (or any other service) from updating automatically?
I know that I can disable it for the panel at the configuration of the upates (via the GUI), but does it also disable the update of the various services?
I’m asking this because I wasn’t aware that Apache was updated (and BTW, in my case it was updated four days ago and I only had the error 421 today!), and I want to control when I update it and the rest.
Thanks - fix it ![]()
Thanks.. Please fix it.
@sahsanu thanks your ROCK! I was thinking that I’v been hacked ![]()