• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How do I properly configure the "Web Application Firewall" rules for a WordPress site so that there is no 500 Internal Server Error?

salauatamet

New Pleskian
I have a website hosted by Goodhost.kz with Plesk control panel. The site is built on WordPress using Elementor. Yesterday, when saving changes to the site through Elementor, there was a "500 Error". Also, there was a "500 Internal Server Error" error when logging into the WordPress admin panel. Hosting tech support told me it was due to a problem with the Modsecurity security module. I went to the Web Application Firewall section and didn’t understand anything about how to set up rules for a WordPress site and what to write there. I didn’t want to disable the module, because it’s not right for security.

Question: How can I properly configure "Web Application Firewall" so that there are no more "500 Internal Server Error" errors?

Here is the entry from the error log:


У меня есть сайт, который находится на хостинге Goodhost.kz с панелью управления Plesk. Сайт сделан на WordPress с использованием Elementor. Вчера при сохранении изменений на сайте через Elementor была "Ошибка 500 Error". Также, была ошибка "500 Internal Server Error" при входе в административную панель Wordpress. Техническая поддержка хостинга мне сказали, что это из-за проблемы с модулем безопасности Modsecurity. Зашел в раздел Брандмауэр для веб-приложений и ничего не понял, как настроить правила для сайта WordPress и что туда писать. Отключать модуль не хотел, потому что так не правильно для безопасности .

Вопрос: Как мне правильно настроить "Брандмауэр для веб-приложений" чтобы, не было больше ошибок "500 Internal Server Error"?

Вот запись из журнала ошибок:

1647111003513.png
 

A page body size of 1 MB (in text) means: 1 million characters. Is your web page really 1 million characters long? Probably not. So better look for the reason why the script tries to deliver such a long page.

One hint is the ap_pass_brigade failure that follows the error.

Often this is caused by a redirect loop inside a page that works similar to this scenario: In side the page body you are including a resource that does not exist. So instead of that resource, a 404 page is delivered and include, however in that 404 page a resource that does not exist is included, so that inside the nested page, another cycle of 404 inclusion appears etc. This is just an example. It can also happen with other error codes and custom error pages that lead to infinite inclusions, hence increase the page size infinitely so that the body size also becomes very large and exceeds the limit.
 
Can you please check your plugins? Of course, you weren't able to access the admin panel so therefore manually (via FTP or SSH) change the plugin's folder name and then try to access your WP dashboard.
If you think it's because of WAF then can you please let us know like is it a Cloudflare or any other?
 
Back
Top