Free auditStart free
GuideError · CDN and hosting errors

Azure Front Door 502

Front Door returns 502 on HTTPS when the origin is an IP address, its certificate name does not match, or the chain is incomplete. Test it with openssl and fix.

4 min
read
4
sources
Oct 31, 2026
updated
Scaplet Editorial Team
author
In one line

Azure Front Door returns a 502 only for HTTPS-enabled endpoints, and Microsoft names three causes: the origin hostname is an IP address, the origin's certificate doesn't match the origin FQDN, or the origin sends a certificate without a complete chain. Your browser hides the third one, so test the origin with openssl s_client -showcerts and count the certificates it returns.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
02Fix it on your stack

Check it in 2 minutes: count the certificates the origin sends

Browsers are the wrong tool here. Microsoft notes that connecting to the origin directly from a browser does not show the error, because the browser rebuilds the chain it thinks it should have instead of showing what the server sent. openssl s_client shows exactly what was returned. Pass the origin hostname with -connect and -servername, or use -noservername if the origin hostname is an IP address.
Healthy origin: a leaf plus intermediates (public example, run on 2026-11-01)
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null 2>&1 \
  | grep -E "^ *[0-9]+ s:|Verify return code"
Observed output: four certificates and verification succeeds
 0 s:CN=example.com
 1 s:C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3
 2 s:C=US, O=SSL Corporation, CN=SSL.com TLS Transit ECC CA R2
 3 s:C=US, O=SSL Corporation, CN=SSL.com TLS ECC Root CA 2022
Verify return code: 0 (ok)
Incomplete chain: a public test host that sends only the leaf
openssl s_client -connect incomplete-chain.badssl.com:443 -servername incomplete-chain.badssl.com -showcerts </dev/null 2>&1 \
  | grep -E "^ *[0-9]+ s:|Verify return code"
Observed output: one certificate and a verification failure
 0 s:CN=*.badssl.com
Verify return code: 21 (unable to verify the first certificate)

That second output is the shape of cause three. Point the same command at your own origin hostname. If you see only line 0 and a nonzero verify code, the origin is serving a leaf without its intermediates, and Front Door will answer 502. The other two causes need no tool: compare your origin hostname in the Front Door settings with the certificate's subject name on line 0.

03How it works

Fix by cause

  1. 1

    Origin is an IP address

    Change the origin to an FQDN that has a valid certificate matching the origin, as Microsoft recommends. If you must keep the IP, disable the name check, and know that an origin whose certificate logic needs a valid SNI may still reject requests.

  2. 2

    Certificate name mismatch

    Issue or install a certificate whose subject name or a subject alternative name matches the origin hostname configured in Front Door.

  3. 3

    Incomplete chain

    Install the leaf and intermediate certificates together on the origin. For Front Door, the root CA must be part of the Microsoft Trusted CA List, and a certificate from a CA that is not on it is rejected.

  4. 4

    Only if you accept the trade-off

    Disabling the name check is documented as a workaround, for example for testing. The origin must still present a valid, trusted chain.

Disable the certificate name check on one origin (Front Door Standard or Premium; needs your profile)
az afd origin update \
  --resource-group <resource-group> \
  --profile-name <profile-name> \
  --origin-group-name <origin-group-name> \
  --origin-name <origin-name> \
  --enforce-certificate-name-check false

I checked in the installed Azure CLI help that az afd origin update takes these arguments, including --enforce-certificate-name-check. I did not run it against a profile. In the portal, Standard and Premium keep this setting with the origin settings when you add an origin to an origin group or configure a route.

04Explained

Not every 5xx from Front Door is a 502

Two neighbours get mistaken for it. A 504 means the origin did not answer within the Origin response timeout, which Microsoft says defaults to 30 seconds and which can be raised on Standard and Premium to between 16 and 240 seconds, shown on the Front Door profile's overview page. A 429 is Front Door applying default platform rate limits. If your errors are 504 and the origin takes about 30 seconds, the certificate steps above will not help; see 504 Gateway Timeout and the wider 502 on Azure page for App Service and Application Gateway.

05Explained

What a Front Door 502 means for SEO

Because the certificate sits at the origin, one defect fails every URL routed to it, so this 502 is site-wide instead of page by page. Google's status code guide says crawlers slow down when they see 5xx, and indexed URLs can be dropped if the failures last. A certificate renewal that installs only the leaf matches cause three, and would turn a working site into a total 502 on the day it takes effect. For finding the affected URLs, see 5xx server errors.
Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01Why does my site work directly but return 502 through Front Door?

Microsoft's guide lists three causes that only appear on HTTPS endpoints: the origin hostname is an IP address, the certificate does not match the origin FQDN, or the certificate chain is incomplete. Direct requests skip Front Door's origin TLS checks.

02Why does my browser show the origin certificate as fine?

Browsers rebuild the chain of trust themselves rather than showing exactly what the server returned. Use openssl s_client -showcerts with -connect and -servername to see what the origin actually sends.

03What is EnforceCertificateNameCheck?

A Front Door setting, enabled by default, that checks the origin hostname against the origin certificate's name or one of its subject alternative names. Disabling it is documented as a workaround, and the certificate must still carry a valid, trusted chain.

Sources · 4

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • microsoft.com
  • google.com
  1. 01Microsoft Learn: Troubleshoot common Azure Front Door issueslearn.microsoft.com · checked 2026-11-01
  2. 02Microsoft Learn: End-to-end TLS with Azure Front Doorlearn.microsoft.com · checked 2026-11-01
  3. 03Microsoft Learn: az afd originlearn.microsoft.com · checked 2026-11-01
  4. 04How HTTP status codes affect Google's crawlersdevelopers.google.com · checked 2026-11-01
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane