asp.net – 502 incorrect gateway in iis 8.0 intermittently

It is a big problem for me. I am facing this problem since last month. We have two application servers that have a different URL called internal URL and we have two more servers in which we have implemented ARR rules that have a set of rules for more 7 applications and access as a public domain. I am getting 502 wrong gateway again and again, but after restarting iis in arr box it starts working. Can anyone share any solution? How can I solve this problem as soon as possible?

Thanks in advance