Load balancer toggels between http 520 and 200 responses

Hey folks,

I’m getting more and more mad onto Cloudflare crappy load balancing Implementation.
If I send a request to my backend servers through the Cloudflare LB service it sometimes gets answered with http200, and everything is fine, and sometimes it will respond to my client with http520 where my log clearly shows that the response has been properly send back the Cloudflare:

{"msec": "1654987524.193", "connection": "228", "connection_requests": "1", "pid": "86", "request_id": "bb9883a2b04368ba2e9fda7cb99d0093", "request_length": "547", "remote_addr": "", "remote_user": "", "remote_port": "53122", "time_local": "11/Jun/2022:22:45:24 +0000", "time_iso8601": "2022-06-11T22:45:24+00:00", "request": "HEAD /media HTTP/2.0", "request_uri": "/media", "args": "", "status": "200", "body_bytes_sent": "0", "bytes_sent": "157", "http_referer": "", "http_user_agent": "Boto3/1.24.5 Python/3.10.2 Linux/5.13.0-48-generic Botocore/1.27.5 Resource", "http_x_forwarded_for": "", "http_host": "test.mydomain.com", "server_name": "test.mydomain.com", "request_time": "0.040", "upstream": "", "upstream_connect_time": "0.000", "upstream_header_time": "0.040", "upstream_response_time": "0.040", "upstream_response_length": "0", "upstream_cache_status": "", "ssl_protocol": "TLSv1.3", "ssl_cipher": "TLS_AES_256_GCM_SHA384", "scheme": "https", "request_method": "HEAD", "server_protocol": "HTTP/2.0", "pipe": ".", "gzip_ratio": "", "http_cf_ray": "719de079889e9bb8-FRA"}
{"msec": "1654987524.329", "connection": "230", "connection_requests": "1", "pid": "86", "request_id": "19be80f5a57c76005407e5f8fae016c5", "request_length": "406", "remote_addr": "", "remote_user": "", "remote_port": "55304", "time_local": "11/Jun/2022:22:45:24 +0000", "time_iso8601": "2022-06-11T22:45:24+00:00", "request": "GET /stream/.ping HTTP/2.0", "request_uri": "/stream/.ping", "args": "", "status": "200", "body_bytes_sent": "0", "bytes_sent": "409", "http_referer": "", "http_user_agent": "python-requests/2.28.0", "http_x_forwarded_for": "", "http_host": "test.mydomain.com", "server_name": "test.mydomain.com", "request_time": "0.000", "upstream": "", "upstream_connect_time": "", "upstream_header_time": "", "upstream_response_time": "", "upstream_response_length": "", "upstream_cache_status": "", "ssl_protocol": "TLSv1.3", "ssl_cipher": "TLS_AES_256_GCM_SHA384", "scheme": "https", "request_method": "GET", "server_protocol": "HTTP/2.0", "pipe": ".", "gzip_ratio": "", "http_cf_ray": "719de07aaaf668ec-FRA"}

It’s extremely annoying as it’s basically impossible to debug this issue for me as Cloudflare is like a black box with no logs I can obtain and always have to wait for a gentle support staff member that maybe or maybe not understands my issue.

Thanks in advance

1 Like

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