I'm having a really frustrating issue whereby I can't seem to upload any images to Wordpress in a post content or via the browser uploader, multi-file uploader.
When uploading a single image directly into Gutenberg I get the loading animation for ages and then a "The response is not a valid JSON response" error. The AJAX response is an error 500. The same thing happens when trying to upload images via the browser uploader in the Wordpress media tab.
The server logs are as follows at the time of the 500 response:
2020-02-12 12:42:27.626436 [INFO] [-Q:CB9E669F502E857E-215#wordpress] [REWRITE] detect external loop redirection with target URL: https://domain.com/wp-admin/admin-ajax.php, skip. 2020-02-12 12:42:38.421757 [INFO] [-Q:CB9E669F502E857E-163#wordpress:lsapi] Connection idle time too long: 301 while in state: 6 watching for event: 8452, close! 2020-02-12 12:42:38.422072 [INFO] [-Q:CB9E669F502E857E-163] Content len: 288523, Request line: POST /wp-json/wp/v2/media?_locale=user HTTP/1.1 2020-02-12 12:42:38.422211 [INFO] [-Q:CB9E669F502E857E-163] Redirect: #1, URL: /index.php
This problem seems to have cropped up very recently as I have previously uploaded images without any issues whatsoever. My Wordpress installation is using a custom theme and several plugins but reverting to a default theme and disabling all plugins doesn't seem to resolve the issue. I have also tried reverting my Wordpress installation itself to an earlier version which again, has no effect in solving the issue.
This is leading me to believe the problem must lie with the server however I'm not particularly sure what the issue could be there either.
The server is a Digital Ocean OpenLiteSpeed WordPress "pre-set" (https://marketplace.digitalocean.com/apps/openlitespeed-wordpress) running on a 2GB droplet.