An Azure service that provides a cloud content delivery network with threat protection.
Hello 이재옥
Greetings! Thanks for raising this question in Q&A forum.
This is a very well-observed issue and the behavior you're seeing is not a curl-specific bug it's actually a route configuration mismatch. Let me explain exactly what's happening and how to fix it properly.
Why curl behaves differently from a browser
Azure Front Door does not treat curl or browsers differently — both are just HTTP clients. The real reason for the inconsistency is that browsers automatically follow redirects while curl -I only shows the first response without following through. But more importantly, the 404 Not Found with X-Cache: CONFIG_NOCACHE you see in curl tells a very specific story — the HTTP request is not hitting your redirect route at all. Instead it is matching a different route that forwards directly to your origin as HTTP, and your origin is returning 404 because it does not serve HTTP traffic.
Step 1: Understand why CONFIG_NOCACHE + 404 happens X-Cache: CONFIG_NOCACHE means Front Door received the request, matched a route, but found no cached content and forwarded it to the origin. The 404 comes from your origin, not from Front Door itself. This means the HTTP request is bypassing your redirect logic entirely and landing on a forwarding route most likely because another route is matching first with higher priority.
Step 2: Check your route priority and pattern matching In the Azure Portal, go to your Front Door profile > Endpoints > your endpoint > Routes. Look carefully at the order and configuration of your routes. The most common cause of this exact issue is:
A route that accepts both HTTP and HTTPS and forwards to the origin is matching the HTTP request before the redirect can fire. Front Door evaluates routes in order and the first matching route wins. If a broad forwarding route (e.g., with pattern /* accepting both HTTP and HTTPS) appears before your redirect route, it will swallow all HTTP requests.
Step 3: The recommended fix — use two separate dedicated routes The correct and explicit way to configure HTTP to HTTPS redirection is to use two separate routing rules:
First, create a route named HttpToHttpsRedirect set the Accepted Protocol to HTTP only, set the Route Type to Redirect, set the Redirect type to Moved (301), and set the Redirect protocol to HTTPS only.
Then create a second route named DefaultForwardingRoute set the Accepted Protocols to HTTPS only, set Route Type to Forward, and set the Forwarding Protocol to HTTPS only.
This completely separates HTTP traffic (which gets redirected) from HTTPS traffic (which gets forwarded), with no overlap or ambiguity.
Step 4: If you prefer to use a Rule Set for the redirect In Azure Front Door Standard/Premium tier, you can configure URL redirect using a Rule Set. Use the 301 (Moved Permanently) status code for HTTP to HTTPS redirection. A Rule Set approach gives you more flexibility and is useful when you need conditional logic, but for simple HTTP to HTTPS enforcement the two-route approach in Step 3 is cleaner and equally reliable.
If you do use a Rule Set, make sure it is associated with the route that accepts HTTP traffic a common mistake is associating the rule set with a route that only accepts HTTPS, which means HTTP requests never hit it.
Step 5: Test correctly with curl after the fix Once you have the two-route setup in place, test with curl using the -L flag which tells curl to follow redirects:
bash
curl -IL http://www.test.com
You should see a 301 Moved Permanently on the first response with a Location: https://www.test.com header, followed by a 200 OK from the HTTPS route. Without -L, you will only see the 301 which is the correct behavior.
Step 6: Wait for propagation After saving any route or Rule Set changes in Front Door, wait 5–10 minutes for the configuration to fully propagate across all edge nodes before retesting.
To directly answer your three questions no, Front Door does not have any special handling for curl vs browsers; the 404 is caused by a route matching issue, not a curl-specific quirk; and yes, using explicit separate routes (or a Rule Set) is a more robust and predictable approach than relying solely on the built-in checkbox when you have multiple routes configured.
If this answer helps you kindly accept the answer which will help others who have similar questions.
Best Regards,
Jerald Felix.