Gateway 502 error

piotrl 0 Reputation points
2023-01-22T00:43:52.6433333+00:00

I cannot connect to my backend server which is azure VM (ubuntu 20.04 server). I've attached error detail and my NSG. I've tried most of the troubleshoot documents from microsoft.

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. To learn more visit - https://aka.ms/servernotreachable.

image

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,213 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Venkita Ramanan, Ramu 56 Reputation points
    2023-01-22T04:19:00.4233333+00:00

    Sorry can't see the error details, but have you checked the ubuntu firewall (ufw) whether the required communication is allowed ? Any other VM in the same subnet can access the Ubuntu on the same ports (as the gateway is trying to reach) ?


  2. msrini-MSFT 9,291 Reputation points Microsoft Employee
    2023-01-22T09:48:43.3133333+00:00

    Hi, Can you check if you have specified the right IP address in the backend pool of Application gateway? Also check if your service is running on port 80 and it is accessible locally. Then you can check your ip tables whether the traffic is allowed or not.

    0 comments No comments

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.