It seems that the Nginx configuration of loop-server rewrite 500 into 502 which is wrong. Also every response should return JSON. (currently return 502 in HTML)
I don't see any logic in the Nginx configuration for Loop Server for converting response codes. Can you give me an example URL that will reproduce this behavior?
As we don't have any response that generates 500 errors, nope :) (and it's a good thing!) I confirm I don't see anything that's creating this behaviour in the puppet recipes, though: https://github.com/mozilla-services/puppet-config/tree/master/loop/modules/loop_server/templates
One way to reproduce the HTML 502 is to stop the loop-server circus daemon and call the nginx server.
Th nginx configuration I had in mind is https://github.com/mozilla-services/puppet-config/blob/master/readinglist/modules/readinglist/templates/nginx_readinglist_config.erb#L20 but it doesn't looks to be the case with Loop. Also we've got a HTML 502 nevertheless if the loop-server is stopped and we reach nginx.