Skip to content

Nginx 400 Bad Request from uploading JPG?  #31

@rickygu

Description

@rickygu

I'm using the code below to upload a jpg that's 2.4MB

content = File.open(temp_file, 'rb', &:read)
response = @b2.put_object(ENV["B2_BUCKET"], b2_path, content)

however, sometimes i'd get the following error:

I - 16:41:02.814: Req POST https://pod-020-3009-00.backblaze.com/b2api/v1/b2_upload_file/ccf1c190a76411bf6b890d1e/c002_v0203009_t0028
D - 16:41:02.814: {:body=>"-- Body 2449446 bytes --", :headers=>{:Authorization=>"xxx=", :"Content-Type"=>"b2/x-auto", :"X-Bz-File-Name"=>"img/348b3dd0af_638924.jpg", :"X-Bz-Content-Sha1"=>"f854bf212675c2bd0d50dc79df9b29a13d2b1326", "Authorization"=>"xxx="}}
I - 16:41:05.169:     Done POST https://pod-020-3009-00.backblaze.com/b2api/v1/b2_upload_file/ccf1c190a76411bf6b890d1e/c002_v0203009_t0028 = 400 (2.355 sec)
D - 16:41:05.169:     Headers: {"Server"=>"nginx", "Date"=>"Mon, 30 Sep 2024 23:41:03 GMT", "Content-Type"=>"text/html", "Content-Length"=>"150", "Connection"=>"close", "Strict-Transport-Security"=>"max-age=63072000"}
D - 16:41:05.169:     Body: <html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

Anyone know what could be the possible issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions