Strange CORS behavior

Hello! Got a real strange problem with CORS on api-only boilerplate.
API available through Apache ReverseProxy and everything works smooth through Postman requests. But Adonis starts to behave unclear when requests come from web-app. Everything looks completely working, but at random moment responses from API cease to contain “Access-Control-Allow-Origin” header and every CORS request fails (from any device, any user, any geolocation).
If i upload file with size of 5MB+, this problem being invoked immediately: all next responses from server dont have “Access-Control-Allow-Origin” too.
Everything starts to work again in 5-10 minutes no matter if i reboot server or just wait.

  1. First try to increase the file upload limit in config/bodyParser.js.
  2. Do you have error logs when this happens?
  3. Try to debug your Adonis application when the request fails. There is nothing one can do without debug your app first.

What are the status codes? Maybe Apache loses connection to Adonis and starts to send responses without CORS headers?
Or are you behind something like CloudFlare, Fastly or similar?