• Register
0 votes

Problem :

I am very new to Azure. Currently I am trying to host my azure website and I have already tried to troubleshoot for the few days, but still I am facing the same error as below:

“502 Web server received an invalid response while acting as a gateway or proxy server.”

2.3k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I have gone through your question related to Azure and I know how to fix the issue.

These 502 errors are not visible in the IIS logs as they are always thrown by your front end server which are basically try to forward your requests to a worker who is hosting your site and you can find many reasons why your front end is returning 502 error.

I had setup with my web servers behind the azure application gateway out of them some servers were working properly but traffic to one of those server was having a 502 issue. So I just followed below approach:

I simply checked my Backend health on my application gateway and I found that one of the server couldn’t be reached.So I tried to open a backend server url on my cloud VM a root of my website can't be reached. But my App was running. It turned out a gateway was supposed to ping a port 80 of a target machine and then I just disabled a root website on a target server. So my gateway assumed my server is dead and just refused to do a redirect.

5k points