cmos99
cmos99

Reputation: 23

azure 502 bad gateway

has anyone seen this before so I am getting a 502 bad gateway error on my app, the issue I have is that the detailed error information I am getting says my requested url is https://SOX:80/api however my site is configured to use https://sox.domain.com and the site largely works pulling the various JS files required

my app service name is SOX in the azure dashboard so I assume that is where it is picking up SOX from but I have no idea why it is using this.

Upvotes: 0

Views: 6655

Answers (2)

cmos99
cmos99

Reputation: 23

So overall the issue had me perplexed... however with more testing I soon figured out what was going on.

my backend is Dotnet core Azure throwing the 502 bad gateway was its way of handling exceptions ultimately the problem was code based. I am mentioning this purely so that it will help others

my first issue was based on cert handling it seems dotnet runs in a container that is specified by your app name as i mentioned above https://SOX:80

the below was causing my issues

sslPolicyErrors = X509StoreStoreHelper.ValidateSSLPolicy(cert.Thumbprint, cert);

after commenting this out for testing my problem went away(we are putting in a proper fix )

my second issue came from using an unsupported view in Azure SQL master.sys.master_files which again just threw a 502 bad gateway error referencing https://SOX:80

please note I have used https://SOX:80 as a reference to mask the real site.

hope this helps the next person.

Upvotes: 1

Bruce Chen
Bruce Chen

Reputation: 18465

Based on your description, I have checked your site (https://sox.azurewebsites.net/) and found that it contains three static files (index.html,generic.html,elements.html). I viewed your website in Chrome incognito window as follows:

enter image description here

I did not find any requests against https://SOX:80/api in your html page or JavaScript files. Please try to access your website in a new incognito window to isolate the cache issue or just press CTRL + F5 to refresh your current page to narrow this issue. Moreover, you need to check whether you have configured URL Rewrite. If you still could not solve this issue, you need to update your question with the details for us to reproduce this issue.

Upvotes: 0

Related Questions