If a web service is returning a 502 Bad Gateway error, what steps would you take to isolate and resolve the issue?