I am trying to connect my VPS origin server with Cloudflare but I am continuously getting Error 522. I have my server running on Amazon lightsail and have connected to it accurately by DNS settings

Error while going to my domain name: “Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish. The most likely cause is that something on your server is hogging resources.”

Regarding Amazon Lightsail, may I sugest below post:

And also you are using a CNAME setup for your domain name or?

Does anything changes if you Pause Cloudflare for your domain?
Or temporary switch the :orange: cloud DNS records to :grey: cloud?

May I ask have you checked the suggestions from the below article?:

Have you checked Firewall at Amazon?, and allowed Cloudflare IP addresses to connect to your new host/origin?
Maybe you need to allow Cloudflare IP addresses to connect to your host/origin server:

Nevertheless, Cloudflare IP addresses list can be found here:

How about your web application?, does it work on a port which is compatible with Cloudflare as follows in the below article:

Before moving to Cloudflare, was your Website working over HTTPS connection?
If so, did you had an valid SSL certificate installed at your origin host / server which covers both your naked (root) domain any any other needed sub-domain like www, mail, etc.?

May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?

Here is a way to re-check if you correctly setup the SSL for your domain with Cloudflare:

In case you do not have an SSL certificate, you can use Cloudflare SSL, if so, kindly make sure you follow the instructions as follows on the below article to setup an SSL certificate using Cloudflare CA Origin Certificate:

Last but not least, kindly have a look here for more information regarding correct SSL settings at the SSL/TLS tab on Cloudflare dashboard:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.