Added Content-type: text/plain to cgi get rid of "Bad Gateway"