I'm using the file upload API to upload files to user accounts via a URL. When I post to the upload_url provided by the API endpoint (e.g. "users/1234/files?as_user_id=1234"), it usually returns a 201 HTTP status code. However, I sometimes get a 502 HTTP status code & HTML that looks like this:
502 Bad Gateway
502 Bad Gateway
nginx
When I check the progress URL for the upload later, though, it shows that the upload has completed successfully. So it looks like the 502 status code does not indicate an error situation? How do I detect that errors that occur for the post to the upload_url, then?