You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cdn/cdn-troubleshoot-endpoint.md
+24-15Lines changed: 24 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,29 +2,29 @@
2
2
title: Troubleshooting Azure CDN endpoints - 404 status code
3
3
description: Learn how to troubleshoot issues with Azure Content Delivery Network endpoints that return 404 HTTP response status codes.
4
4
services: cdn
5
-
documentationcenter: ''
6
-
author: zhangmanling
7
-
manager: erikre
8
-
editor: ''
9
-
5
+
author: duongau
6
+
manager: kumudd
10
7
ms.assetid: b588a1eb-ab69-4fc7-ae4d-157c3e46f4a8
11
8
ms.service: azure-cdn
12
9
ms.workload: tbd
13
10
ms.tgt_pltfrm: na
14
11
ms.topic: troubleshooting
15
-
ms.date: 01/23/2017
16
-
ms.author: mazha
12
+
ms.date: 02/27/2023
13
+
ms.author: duau
17
14
18
15
---
19
16
# Troubleshooting Azure CDN endpoints that return a 404 status code
17
+
20
18
This article enables you to troubleshoot issues with Azure Content Delivery Network (CDN) endpoints that return 404 HTTP response status codes.
21
19
22
20
If you need more help at any point in this article, you can contact the Azure experts on [the MSDN Azure and the Stack Overflow forums](https://azure.microsoft.com/support/forums/). Alternatively, you can also file an Azure support incident. Go to the [Azure Support site](https://azure.microsoft.com/support/options/) and select **Get Support**.
23
21
24
22
## Symptom
23
+
25
24
You've created a CDN profile and an endpoint, but your content doesn't seem to be available on the CDN. Users who attempt to access your content via the CDN URL receive an HTTP 404 status code.
26
25
27
26
## Cause
27
+
28
28
There are several possible causes, including:
29
29
30
30
* The file's origin isn't visible to the CDN.
@@ -33,6 +33,7 @@ There are several possible causes, including:
33
33
* The endpoint hasn't had time to propagate throughout the CDN.
34
34
35
35
## Troubleshooting steps
36
+
36
37
> [!IMPORTANT]
37
38
> After creating a CDN endpoint, it will not immediately be available for use, as it takes time for the registration to propagate through the CDN:
38
39
> - For **Azure CDN Standard from Microsoft** profiles, propagation usually completes in ten minutes.
@@ -44,6 +45,7 @@ There are several possible causes, including:
44
45
>
45
46
46
47
### Check the origin file
48
+
47
49
First, verify that the file to cache is available on the origin server and is publicly accessible on the internet. The quickest way to do that is to open a browser in a private or incognito session and browse directly to the file. Type or paste the URL into the address box and verify that it results in the file you expect. For example, suppose you have a file in an Azure Storage account, accessible at https:\//cdndocdemo.blob.core.windows.net/publicblob/lorem.txt. If you can successfully load this file's contents, it passes the test.
@@ -54,7 +56,8 @@ First, verify that the file to cache is available on the origin server and is pu
54
56
>
55
57
56
58
### Check the origin settings
57
-
After you've verified the file is publicly available on the internet, verify your origin settings. In the [Azure Portal](https://portal.azure.com), browse to your CDN profile and select the endpoint you're troubleshooting. From the resulting **Endpoint** page, select the origin.
59
+
60
+
After you've verified the file is publicly available on the internet, verify your origin settings. In the [Azure portal](https://portal.azure.com), browse to your CDN profile and select the endpoint you're troubleshooting. From the resulting **Endpoint** page, select the origin.
58
61
59
62

Verify that the values of the **Origin type** and **Origin hostname** are correct. In this example, https:\//cdndocdemo.blob.core.windows.net/publicblob/lorem.txt, the hostname portion of the URL is *cdndocdemo.blob.core.windows.net*, which is correct. Because Azure Storage, Web App, and Cloud Service origins use a drop-down list value for the **Origin hostname** field, incorrect spellings aren't an issue. However, if you use a custom origin, ensure that your hostname is spelled correctly.
67
71
68
72
#### HTTP and HTTPS ports
69
-
Check your **HTTP** and **HTTPS ports**. In most cases, 80 and 443 are correct, and you will require no changes. However, if the origin server is listening on a different port, that will need to be represented here. If you're not sure, view the URL for your origin file. The HTTP and HTTPS specifications use ports 80 and 443 as the defaults. In the example URL, https:\//cdndocdemo.blob.core.windows.net/publicblob/lorem.txt, a port is not specified, so the default of 443 is assumed and the settings are correct.
70
73
71
-
However, suppose the URL for the origin file that you tested earlier is http:\//www.contoso.com:8080/file.txt. Note the *:8080* portion at the end of the hostname segment. That number instructs the browser to use port 8080 to connect to the web server at www\.contoso.com, therefore you'll need to enter *8080* in the **HTTP port** field. It's important to note that these port settings affect only what port the endpoint uses to retrieve information from the origin.
74
+
Check your **HTTP** and **HTTPS ports**. In most cases, 80 and 443 are correct, and you require no changes. However, if the origin server is listening on a different port, that needs to be represented here. If you're not sure, view the URL for your origin file. The HTTP and HTTPS specifications use ports 80 and 443 as the defaults. In the example URL, https:\//cdndocdemo.blob.core.windows.net/publicblob/lorem.txt, a port isn't specified, so the default of 443 is assumed and the settings are correct.
75
+
76
+
However, suppose the URL for the origin file that you tested earlier is http:\//www.contoso.com:8080/file.txt. Note the *: 8080* portion at the end of the hostname segment. That number instructs the browser to use port 8080 to connect to the web server at www\.contoso.com, therefore you need to enter *8080* in the **HTTP port** field. It's important to note that these port settings affect only what port the endpoint uses to retrieve information from the origin.
72
77
73
78
> [!NOTE]
74
79
> **Azure CDN Standard from Akamai** endpoints do not allow the full TCP port range for origins. For a list of origin ports that are not allowed, see [Azure CDN from Akamai Allowed Origin Ports](/previous-versions/azure/mt757337(v=azure.100)).
75
80
>
76
81
>
77
82
78
83
### Check the endpoint settings
84
+
79
85
On the **Endpoint** page, select the **Configure** button.
80
86
81
87

@@ -85,17 +91,20 @@ The CDN endpoint **Configure** page appears.
For **Protocols**, verify that the protocol being used by the clients is selected. Because the same protocol used by the client is the one used to access the origin, it's important to have the origin ports configured correctly in the previous section. The CDN endpoint listens only on the default HTTP and HTTPS ports (80 and 443), regardless of the origin ports.
89
96
90
-
Let's return to our hypothetical example with http:\//www.contoso.com:8080/file.txt. As you'll remember, Contoso specified *8080* as their HTTP port, but let's also assume they specified *44300* as their HTTPS port. If they created an endpoint named *contoso*, their CDN endpoint hostname would be *contoso.azureedge.net*. A request for http:\//contoso.azureedge.net/file.txt is an HTTP request, so the endpoint would use HTTP on port 8080 to retrieve it from the origin. A secure request over HTTPS, https:\//contoso.azureedge.net/file.txt, would cause the endpoint to use HTTPS on port 44300 when retrieving the file from the origin.
97
+
Let's return to our hypothetical example with http:\//www.contoso.com:8080/file.txt. As you remember, Contoso specified *8080* as their HTTP port, but let's also assume they specified *44300* as their HTTPS port. If they created an endpoint named *contoso*, their CDN endpoint hostname would be *contoso.azureedge.net*. A request for http:\//contoso.azureedge.net/file.txt is an HTTP request, so the endpoint would use HTTP on port 8080 to retrieve it from the origin. A secure request over HTTPS, https:\//contoso.azureedge.net/file.txt, would cause the endpoint to use HTTPS on port 44300 when retrieving the file from the origin.
91
98
92
99
#### Origin host header
93
-
The **Origin host header** is the host header value sent to the origin with each request. In most cases, this should be the same as the **Origin hostname** we verified earlier. An incorrect value in this field won't generally cause 404 statuses, but is likely to cause other 4xx statuses, depending on what the origin expects.
100
+
101
+
The **Origin host header** is the host header value sent to the origin with each request. In most cases, this value should be the same as the **Origin hostname** we verified earlier. An incorrect value in this field doesn't cause a 404 statuses, but is likely to cause other 4xx statuses, depending on what the origin expects.
94
102
95
103
#### Origin path
96
-
Lastly, we should verify our **Origin path**. By default this is blank. You should only use this field if you want to narrow the scope of the origin-hosted resources you want to make available on the CDN.
97
104
98
-
In the example endpoint, we wanted all resources on the storage account to be available, so **Origin path** was left blank. This means that a request to https:\//cdndocdemo.azureedge.net/publicblob/lorem.txt results in a connection from the endpoint to cdndocdemo.core.windows.net that requests */publicblob/lorem.txt*. Likewise, a request for https:\//cdndocdemo.azureedge.net/donotcache/status.png results in the endpoint requesting */donotcache/status.png* from the origin.
105
+
Lastly, we should verify our **Origin path**. By default this path is blank. You should only use this field if you want to narrow the scope of the origin-hosted resources you want to make available on the CDN.
106
+
107
+
In the example endpoint, we wanted all resources on the storage account to be available, so **Origin path** was left blank. Therefore, a request to https:\//cdndocdemo.azureedge.net/publicblob/lorem.txt results in a connection from the endpoint to cdndocdemo.core.windows.net that requests */publicblob/lorem.txt*. Likewise, a request for https:\//cdndocdemo.azureedge.net/donotcache/status.png results in the endpoint requesting */donotcache/status.png* from the origin.
99
108
100
-
But what if you don't want to use the CDN for every path on your origin? Say you only wanted to expose the *publicblob* path. If we enter */publicblob* in the **Origin path** field, that will cause the endpoint to insert */publicblob* before every request being made to the origin. This means that the request for https:\//cdndocdemo.azureedge.net/publicblob/lorem.txt will now actually take the request portion of the URL, */publicblob/lorem.txt*, and append */publicblob* to the beginning. This results in a request for */publicblob/publicblob/lorem.txt* from the origin. If that path doesn't resolve to an actual file, the origin will return a 404 status. The correct URL to retrieve lorem.txt in this example would actually be https:\//cdndocdemo.azureedge.net/lorem.txt. Note that we don't include the */publicblob* path at all, because the request portion of the URL is */lorem.txt* and the endpoint adds */publicblob*, resulting in */publicblob/lorem.txt* being the request passed to the origin.
109
+
But what if you don't want to use the CDN for every path on your origin? Say you only wanted to expose the *public blob* path. If we enter */publicblob* in the **Origin path** field, that is going to cause the endpoint to insert */publicblob* before every request being made to the origin. So the request for https:\//cdndocdemo.azureedge.net/publicblob/lorem.txt now takes the request portion of the URL, */publicblob/lorem.txt*, and append */publicblob* to the beginning. Resulting in a request for */publicblob/publicblob/lorem.txt* from the origin. If that path doesn't resolve to an actual file, the origin returns a 404 status. The correct URL to retrieve lorem.txt in this example would actually be https:\//cdndocdemo.azureedge.net/lorem.txt. We don't include the */publicblob* path at all, because the request portion of the URL is */lorem.txt* and the endpoint adds */publicblob*, resulting in */publicblob/lorem.txt* being the request passed to the origin.
0 commit comments