Change http code to 502 from 404, when requested application is unavailable