Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I am hosting an app using DO’s MEAN droplet. When I was trying to post a specific data using a POST api at the frontend (angularjs), it gives me the below error message.
Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH Failed to load resource: the server responded with a status of 502 (Bad Gateway)
This POST api will save a picture file to the /public directory within the app according to the country folder and also it will update the data to mongodb.
The strange thing is the error only appears when i was doing a POST to one particular country with a picture uploaded. It works fine if i am just posting text data. And after the error appeared, I checked the database the data is updated, but the picture is not saved at that country’s folder. I can get do a GET to that country’s data or picture without issue.
*the POST api is not country specific
When i looked at the nginx log, it says: 2017/03/24 06:53:06 [error] 5309#5309: *66813 upstream prematurely closed connection while reading upstream, client: 175.156.60.170, s$ 2017/03/24 06:53:06 [error] 5309#5309: *66788 connect() failed (111: Connection refused) while connecting to upstream, client: 175.156$ 2017/03/24 06:53:06 [error] 5309#5309: *66788 connect() failed (111: Connection refused) while connecting to upstream, client: 175.156$ 2017/03/24 06:53:06 [error] 5309#5309: *66846 connect() failed (111: Connection refused) while connecting to upstream, client: 175.156$ 2017/03/24 06:53:06 [error] 5309#5309: *66847 connect() failed (111: Connection refused) while connecting to upstream, client: 175.156$
Could anyone tell me what is the issue and how to resolve this? Thank you
56bd8300516443db8f6e925c6721b4
affiliatetrading
admin
saeeddarabi
djanym
skeddtemp
gebelo
martinjameslynn
Brenda Morales
d02e0b7b59c2429cb46fcbb782