Start mirror when HTTP status code is 502

Mirror url can respond with status 502 when it is not started and it's running as upstream server.
Like when developing on a cloud IDE like nitrous.io. These are proposed changes to start mirror when 502 status is returned.