502 Bad Gateway Error

RADU STEFAN CODREANU 5 Reputation points
2023-01-13T23:59:17.7066667+00:00

So last week I have made a Scale Set with this tutorial let's say: [https://learn.microsoft.com/en-us/azure/load-balancer/tutorial-add-lb-existing-scale-set-portal

As operating system I choose a Image of a VM that I have created earlier, with nginx installed and a script to show, when accessing the public IP of instances on browser with which VM Instance is running (scalling). After following that tutorial, it worked just fine. I installed email-communication, blob and CosmosDB on the first Instance. After that, I stopped both Instances and Started them again after a week, getting 502 Bad Gateway error when accessing the IP.

So I tried stopping/starting both Instances, same error. I tried to change from '/var/www/html' the 'index.nginx-debian.html' with sudo nano, in order to append some random charachers. After that, I saved and executed 'sudo reboot'. When checking if the changes were made after reboot, I saw that the same original message was there, without changes I've made earlier on.

Both VMs in the scale set were displaying properly when connecting via http, but with no changes made, is throwing a 502 error.

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
448 questions
{count} vote

1 answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,586 Reputation points Microsoft Employee
    2023-01-16T11:54:05.27+00:00

    Hello @RADU STEFAN CODREANU ,

    Welcome to Microsoft QnA.

    It's hard to say exactly what the problem is without more information about your setup, but below is a document that specifically addresses this error. Please take a look at it and go through all the steps and let me know if it helps.

    https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-troubleshooting-502

    If you have further questions, please reach back via a reply. Thank you.


    Please accept as answer and upvote if the above information is helpful.

    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.