Hi Elias,
Error 522 typically occurs when you are using Cloudflare. It means Cloudflare attempted to connect to your server (where Joomla is hosted), but the server failed to respond within the required timeframe (a TCP handshake error).
Here are the steps to resolve this issue:
- Verify Server Status
Before changing any settings, ensure your hosting server is operational.
- Try accessing your site directly via the server's IP address (if your hosting allows it).
- Check your hosting control panel (cPanel/DirectAdmin) for high CPU or RAM usage. An overloaded Joomla site (often caused by "heavy" plugins) may fail to respond in time.
- Match IP Addresses in Cloudflare
A 522 error often occurs if Cloudflare is routing traffic to an outdated or incorrect IP address.
- Log in to your Cloudflare dashboard and go to the DNS section.
- Check the A record for your domain.
- Ensure the IP address listed there exactly matches the current IP address provided by your hosting provider.
- Whitelist Cloudflare IP Addresses
Your server's firewall may misidentify the high volume of requests from Cloudflare as an attack and block them.
- You must add the Cloudflare IP ranges to your server’s whitelist.
- This can be done via your hosting firewall settings.
- You can also add rules to your .htaccess file:
<IfModule mod_authz_core.c>
Require ip 103.21.244.0/22
# ... and other Cloudflare IPs
</IfModule>
- Enable Keep-Alive
Cloudflare requires persistent connections. If your server terminates connections too quickly, it will trigger a 522 error. You can try to force Keep-Alive by adding this code to your Joomla .htaccess file:
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>