502 Bad Gateway nginx/1.14.0 (Ubuntu) while using ODK aggregate

Have you tried rebooting your server?