Google Cloud load balancer with Wasabi s3: backend_connection_closed_before_data_sent_to_client error

I’m setting up a Google Cloud Load Balancer with an external backend pointing to a Wasabi S3 bucket. The objective is to serve video files from the Wasabi bucket through the load balancer and Cloud CDN. However, I’m consistently getting a 502 Bad Gateway error. With the logs specifying: ‘backend_connection_closed_before_data_sent_to_client’.

Setup Details:

I am new to working with the cloud so following Google’s docs I made sure of completing these steps:

  • SSL certificate: I set up a google managed SSL cert that includes but mydomain.com and www.mydomain.com (active)
  • NEG: I set up a NEG that points to wasabi, with s3.us-west-1.wasabisys.com as the FQDN and port 443
  • Load balancer: First I made sure to add a permission to allow Google’s IPs to send requests to my bucket. Then I set up a load balancer following this other guide. I configured the load balancer with those same settings except later I had to switch the backend protocols from http/2 to http since wasabi was not responding to http2 requests. In the backend configuration of the load balancer I have 2 services, one of them created when setting up the load balancer and the 2nd one as a “new” service (named user-clips) as per the first linked guide. I also made sure to add Host: s3.us-west-1.wasabisys.com in the custom request headers.
  • Host and path rules: I added a new rule that looks like this Host: *, Paths: /all-users-clip-storage-wasabi/*, Backend: user-clips.
  • Private origins: The bucket is not public so I had to configure private origin auth.

The problem:
When I try to make requests to the bucket through the CDN I get different errors depending on how I try to access it. When I use google’s example:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>time wget "https://my_load_balancer_ip/all-users-clip-storage-wasabi/all-users-projects/exampleUser/project-name-placeholder/video_file.mp4
</code>
<code>time wget "https://my_load_balancer_ip/all-users-clip-storage-wasabi/all-users-projects/exampleUser/project-name-placeholder/video_file.mp4 </code>
time wget "https://my_load_balancer_ip/all-users-clip-storage-wasabi/all-users-projects/exampleUser/project-name-placeholder/video_file.mp4

I get the following error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>The certificate's owner does not match hostname ‘my_load_balancer_ip’
</code>
<code>The certificate's owner does not match hostname ‘my_load_balancer_ip’ </code>
The certificate's owner does not match hostname ‘my_load_balancer_ip’

When I replace the IP with my domain (with or w/o the www):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Resolving www.mydomain.com (www.mydomain.com)... {my_load_balancer_ip}
Connecting to www.mydomain.com (www.mydomain.com)|{my_load_balancer_ip}|:443... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2024-08-08 23:50:46 ERROR 502: Bad Gateway.
real 0m0.342s
user 0m0.017s
sys 0m0.005s
</code>
<code>Resolving www.mydomain.com (www.mydomain.com)... {my_load_balancer_ip} Connecting to www.mydomain.com (www.mydomain.com)|{my_load_balancer_ip}|:443... connected. HTTP request sent, awaiting response... 502 Bad Gateway 2024-08-08 23:50:46 ERROR 502: Bad Gateway. real 0m0.342s user 0m0.017s sys 0m0.005s </code>
Resolving www.mydomain.com (www.mydomain.com)... {my_load_balancer_ip}
Connecting to www.mydomain.com (www.mydomain.com)|{my_load_balancer_ip}|:443... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2024-08-08 23:50:46 ERROR 502: Bad Gateway.

real    0m0.342s
user    0m0.017s
sys     0m0.005s

And this is the log from that failed request:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>statusDetails: "backend_connection_closed_before_data_sent_to_client"
</code>
<code>statusDetails: "backend_connection_closed_before_data_sent_to_client" </code>
statusDetails: "backend_connection_closed_before_data_sent_to_client"

I read from other sources that the issue lies in the load balancer is sending traffic to another entity with a short timeout. But as you can see from the logs the answer to the request is almost instant (less 1 second).

I already tried:

  1. Setting the TCP to 600s
  2. Verified the SSL certificate is active for both domains
  3. Updated the protocol from HTTP/2 to HTTP
  4. Using pre signed URL’s
  5. Ensured private origin authentication is configured correctly.

Questions:

  1. What could be causing the 502 Bad Gateway error in this setup?
  2. Are there additional configurations required to ensure the load
    balancer communicates correctly with the Wasabi S3 backend?
  3. How can I verify if the load balancer is properly routing requests
    to the backend service?

Let me know if I can provide anymore context please.
Any guidance on resolving this issue would be greatly appreciated. Thank you!!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật