Hi Daniele,
it seems like the problem is coming from the nginx web server. When the script is returning the language data, it actually tries to send these data to the server but your server is triggering a 502 bad gateway error.
http://take.ms/0IIKP
I believe, there is probably some security addon or filtering on your web server's level. Could you check this with your web host please?