title: php - laravel rest api sometimes throws socket hang up or ECONNRESET error
body: <p>We have developed laravel based rest API and hosted it on AWS EC2. The app is working fine and the API also works fine. However, we are facing a strange issue. Sometimes, the API starts returning socket hang up or ECONNRESET error. It seems like the issue is somehow tied to a specific API because once we start getting the error, all the devices connected to the same router/global IP are not able to get any response from the API server. All devices get the same error that socket hangup or ECONNRESET</p>
  <p>At the same time, other devices connected from other IPs work fine and get a normal response from the API server. A solution we have used is to restart the router. If it is a mobile phone, then switching the network or taking the phone to flight mode and turning it back on also solves the issue (in our opinion, it changes the IP address and then it starts working again)</p>
  <p>This does not always happen but once we start getting the error, we have to reset the device connected to the internet.</p>
  <p>I have searched on google but have not found any solution for this. Can someone please give some direction on how to get this fixed?</p>
  <p>Regards
  Syed</p>