Apache2 SSL (full) not working 521

I’m new to cloudflare and just got some basics working. I can use SSL off and flexible, but anything higher doesn’t work. If I set it to Full/Full(strict) my node js services still work fine, but the main website that uses apache2 doesn’t work. It always says “Error 521 Web server is down”. I enabled SSL in the website config file just like pretty much every tutorial suggests. I added an origin certificate and added it to the config too. I restarted the apache2 service at least a hundred times during the entire process and I never got any issues. I ran it with loglevel trace8 and I still didn’t get any clue on why the page isn’t available. Here’s a peak into everything that may be useful:

/etc/apache2/sites-available/mywebsite com conf
<VirtualHost *:443>
ServerAdmin [email protected] com
ServerName mywebsite com
ServerAlias mywebsite com
DocumentRoot /var/www/mywebsite com/html/
ErrorLog /var/www/mywebsite com/logs/error log
CustomLog /var/www/mywebsite com/logs/access log combined

    SSLEngine on
    SSLCertificateFile /etc/cloudflare/mywebsite com pem
    SSLCertificateKeyFile /etc/cloudflare/mywebsite com key
    SSLCACertificateFile /etc/cloudflare/origin_ca_rsa_root pem

#systemctl status apache2
apache2 service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2 service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-10-27 17:07:59 CET; 55s ago
Docs: https://httpd apache org/docs/2 4/
Process: 6534 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 6538 (apache2)
Tasks: 55 (limit: 2359)
Memory: 5 7M
CGroup: /system slice/apache2 service
├─6538 /usr/sbin/apache2 -k start
├─6539 /usr/sbin/apache2 -k start
└─6540 /usr/sbin/apache2 -k start

Oct 27 17:07:59 servername systemd[1]: Starting The Apache HTTP Server...
Oct 27 17:07:59 servername apachectl[6534]: [Tue Oct 27 17:07:59 594633 2020] [core:trace3] [pid 6537:tid 139799920157824] core c(3355): Setting LogLevel for all modules to trace8
Oct 27 17:07:59 servername systemd[1]: Started The Apache HTTP Server.

certificates and keys have this kind of structure

#apachectl -t
Syntax OK

When I click on the Speed tab on cloudflare, it used to say that my website returned 521 too, but it started to work a few hours ago, not sure what caused it to work though. When I use troubleshooting tools it only says my website returns 521, everything else is configured properly and I don’t ever get any SSL issues, the certificate is fine. I guess that apache2 has some communication issues with the certificate and cloudflare though, but that’s just a guess.

This topic was automatically closed after 31 days. New replies are no longer allowed.