Error 521 - Web server is down (Forge/Cloudflare/DigitalOcean)
Hi all,
I'm trying to host my project without success.
www.programandoconsergio.com
When I load the site I get an "Error 521 - Web server is down" message from Cloudflare or "This site can’t be reached / ERR_CONNECTION_CLOSED" sometimes.
I created a server using Laravel Forge, then I have Cloudflare managing the DNS (Domain from GoDaddy), and the droplet running on Digital Ocean.
I created an SSL certificate on Cloudflare, it's installed on Laravel Forge (main domain and a subdomain).
The DNS options seem to be ok.
Setting your encryption mode to Flexible makes your site partially secure. Cloudflare allows HTTPS connections between your visitor and Cloudflare, but all connections between Cloudflare and your origin are made through HTTP. As a result, an SSL certificate is not required on your origin.
pointed at the error, which was one or more SSL related files having a wrong path or were unreachable at the nginx configuration file. You can reach this file directly to FORGE, under your site and click on "Edit Files" and then select "Edit Nginx Configuration"
In my case at this file I modified the corresponding certificate and certificate keys
be sure that you have ssl certificates already installed on your site. If you don't know how to generate these google "cloudflare ssl nginx" or "cloudflare ssl forge"