title: Google cloud load balancer causing error 502 - failed_to_pick_backend
body: <p>I've got an error 502 when I use google cloud balancer with CDN, the thing is, I am pretty sure I must have done something wrong setting up the load balancer because when I remove the load balancer, my website runs just fine.</p>
  <p>This is how I configure my load balancer
  <a href="https://i.stack.imgur.com/ZCcGb.png" rel="noreferrer">here</a></p>
  <ul>
  <li>Should I use HTTP or HTTPS healthcheck, because when I set up HTTPS
  healthcheck, my website was up for a bit and then it down again</li>
  <li>I have checked this <a href="https://stackoverflow.com/questions/49272380/502-server-error-sometime-on-google-compute-engine">link</a>, they seem to have the same problem but it is not working for me.</li>
  <li>I have followed a tutorial from openlitespeed forum to set Keep-Alive Timeout (secs) = 60s in server admin panel and configure instance to accepts <a href="https://cloud.google.com/compute/docs/troubleshooting/general-tips#communicatewithinternet" rel="noreferrer">long-lived connections</a> ,still not working for me.</li>
  <li>I have added these 2 firewall rules following this google cloud link to allow google health check ip but still didn’t work:
  <a href="https://cloud.google.com/load-balancing/docs/health-checks#fw-netlb" rel="noreferrer">https://cloud.google.com/load-balancing/docs/health-checks#fw-netlb</a>
  <a href="https://cloud.google.com/load-balancing/docs/https/ext-http-lb-simple#firewall" rel="noreferrer">https://cloud.google.com/load-balancing/docs/https/ext-http-lb-simple#firewall</a></li>
  </ul>
  <p>When checking load balancer log message, it shows an error saying failed_to_pick_backend . I have tried to re-configure load balancer but it didn't help.</p>
  <p>I just started to learn Google Cloud and my knowledge is really limited, it would be greatly appreciated if someone could show me step by step how to solve this issue. Thank you!</p>
  <hr />