Using the latest version of learning locker, I get the following nginx error when querying the /api/statements/aggregate endpoint.
upstream prematurely closed connection while reading response header from upstream
This only happens when the amount of data that is requested is large.