locked
Endpoints redirecting to origin RRS feed

  • Question

  • We have three endpoints set up for the same origin (e.g. mycorp-cdn1, mycorp-cdn2 and mycorp-cdn3). The first endpoint (mycorp-cdn1) works perfectly, however, the other two keep redirecting image requests back to the origin. For example, if I request mycorp-cdn1.azureadge.net/images/foo.gif, the CDN replies with 200 OK and serves the image. If I request the same image with any of the other two endpoints, the CDN replies with 301 Moved Permanently and redirects me to the image at the origin (e.g. www.mycorp.com/images/foo.gif).

    Any ideas as to what might be the cause of this behaviour?

    Monday, December 14, 2015 1:30 PM

All replies

  • By default, the CDN will honor cache-control headers set at the origin for a particular object.  If you can paste in the request & response headers on the request here that 301s, it might lend some insight into what's happening. 
    Tuesday, December 22, 2015 8:02 PM
  • These are the requests/responses from endpoint1 (working) and endpoint2 (redirecting):

    Endpoint 1

    Request Headers:
    GET /images/example.jpeg HTTP/1.1
    Host: xxx-cdn1.azureedge.net
    Connection: keep-alive
    Pragma: no-cache
    Cache-Control: no-cache
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
    DNT: 1
    Accept-Encoding: gzip, deflate, sdch
    Accept-Language: en-US,en;q=0.8,sv;q=0.6

    Response Headers:
    HTTP/1.1 200 OK
    Accept-Ranges: bytes
    Cache-Control: public
    Content-Dis;filename="example.jpeg"
    Content-Type: image/jpeg; charset=utf-8
    Date: Wed, 23 Dec 2015 19:03:32 GMT
    Etag: 08D289CE05A40C28
    Expires: Thu, 22 Dec 2016 19:03:32 GMT
    Last-Modified: Sat, 11 Jul 2015 06:52:16 GMT
    Server: ECAcc (sto/EA25)
    X-AspNet-Version: 4.0.30319
    X-Cache: HIT
    Content-Length: 87142

    Endpoint 2

    Request Headers:
    GET /images/example.jpeg HTTP/1.1
    Host: xxx-cdn2.azureedge.net
    Connection: keep-alive
    Pragma: no-cache
    Cache-Control: no-cache
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Upgrade-Insecure-Requests: 1
    User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36
    DNT: 1
    Accept-Encoding: gzip, deflate, sdch
    Accept-Language: en-US,en;q=0.8,sv;q=0.6

    Response Headers:
    HTTP/1.1 301 Moved Permanently
    Content-Type: text/html; charset=UTF-8
    Date: Wed, 23 Dec 2015 19:08:18 GMT
    Location: http://www.xxx.se/images/example.jpeg
    Server: Microsoft-IIS/8.5
    Content-Length: 295

    Wednesday, December 23, 2015 7:17 PM
  • Can you share the actual name of Endpoint #2?

    Unless you have set a specific or intentional rule using the Rules Engine feature (available if you've set up the endpoint under a Premium profile) to redirect on this particular endpoint, there would be nothing in place on the CDN to force a 301 response by default.  I would suggest to open a ticket with Azure Support and provide a URL in order to reproduce the issue.

    The "Server: Microsoft-IIS/8.5" response header suggests that this behavaior is being set by the origin server.

    Thursday, December 31, 2015 4:17 AM