curl: (52) Empty reply from server

Hi

I am using elixir 1.6.6 and OTP 20 in my micro service hosted on ubuntu based ec2 machine in aws.

I am facing a problem whenever I am doing curl to get connection verification regarding my db.
curl: (52) Empty reply from server

but when I restart my micro service , it starts to work fine but after sometimes it again started to same issue. I found solution for distillery and phoenix
https://github.com/bitwalker/distillery/issues/37.

But I am not using distillery and phoenix .

Any idea how can i resolve it in elixir.

Thanks
Shree Prakash