Azure 502 Bad Gateway Issue

Mohammed Shafi 0 Reputation points
2025-01-15T15:23:59.74+00:00

I use an application gateway with WAF setup to run our web application deployed in a single Azure VM.

When I access the application through App GW from the browser, I sometimes get a 502 Bad Gateway error. The App GW health probe responds with, "Cannot connect to backend server. Check whether any NSG/UDR/Firewall is blocking access to the server. Check if application is running on correct port."

This issue does not always occur. Whenever I hit the server multiple times, this issue occurs, and it will fix itself automatically after some time or if I clear the browser cache.

In App GW log, I get sometime "error_info_s: ERRORINFO_UPSTREAM_NO_LIVE" or "ERRORINFO_UPSTREAM_CLOSED_CONNECTION".

Is this behaviour of App GW or any solution to fix the issue.? Appreciate your suggestions or sharing your experiences.

Bknd_health

Bknd_health_success

Connectivity Details When Error Occure

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,109 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.