Error 522 Connection Timed Out

0

Hi Team,

I have created two seprate zone in Rout53 for doman and subdomain.

  1. example.com -> created hosting zone in Route53
  2. subdomain.example.com -> created hosting zone in Route53
  3. Added NS record of **subdomain.example.com **in hosting zone of example.com
  4. Both website is working fine example.com and subdomain.example.com without SSL.
  5. Y'day I have configured Cloudflare , after configured, only main domain (website) is working example.com fine but subdomain subdomain.example.com website getting an error **Error 522 Connection Timed Out. ** . Both Ec2 Instance are working fine, and active mode. Security group added to allow port 80, 443 in Ec2 instance.

I have spent 6 hours but not issue resolved. please help on the same.

Thanks & Reagards

4개 답변
0

Hello.

Looking at the CloudFlare documentation, it states that the cause is that the origin EC2 cannot be accessed properly.
I think you need to check the difference in settings between the main domain and the subdomain.
Also, if you access EC2 directly, do you agree that you can access normally?
https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-522-connection-timed-out

  • (Most common cause) Cloudflare IP addresses are rate limited or blocked in .htaccess, iptables, or firewalls. Confirm your hosting provider allows Cloudflare IP addresses.
  • An overloaded or offline origin web server drops incoming requests.
  • Keepalives are disabled at the origin web server.
  • The origin IP address in your Cloudflare DNS app does not match the IP address currently provisioned to your origin web server by your hosting provider.
  • Packets were dropped at your origin web server.
profile picture
전문가
답변함 8달 전
profile pictureAWS
전문가
검토됨 8달 전
0

To confirm, https://example.com/ is all good? Browser connects to Cloudflare using SSL, then Cloudflare connects to nginx on EC2 (also using SSL?). This means that nginx is listening on the correct port (is this 443 ?) and is presenting a certificate that Cloudflare trusts.

https://subdomain.example.com/ is giving a 522 error, which means it's timing out when trying to contact nginx https://developers.cloudflare.com/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-522-connection-timed-out

Check the port on which Cloudflare is trying to connect, and that nginx is listening on this port. If a host-based firewall is running (could be iptables or firewalld or ufw, etc.) then check it's allowing inbound traffic on that port. Check also that nginx is presenting a valid certificate.

profile picture
전문가
Steve_M
답변함 8달 전
  • Hi Steve,

    Your right. The issue is resolved after added port 443 on NGINX server.

    Thank you so much. :-)

0

Hi Team,

I have added all https://www.cloudflare.com/ips-v4 ips in secuirty group of dashboard Ec2 instance.

It was working without Cloudflare. but when added CloudFlare its not working.

I can access directly Ec2 insance using SSH key-pair value and alos i checked on browser using that ip address with different port on browser directly, its displaying index nginx page. so its working there. But when I access using subdomain name then getting an error.

Regards

Krishna
답변함 8달 전
0

Alos I added rule for all ips 0.0.0.0/0 but still getting same issue.

Krishna
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠