locked
Azure static website does not return 404.html page RRS feed

  • Question

  • Hi Azure experts,

    I set up a static website on Azure Blob storage with these settings:


    The problem is, even though I specified an error document, this is what Azure shows in the browser when requesting a page that doesn't exist:


    The weird thing is, is that when I navigate to my 404.html page, it renders properly in the browser:


    So the page is there and it renders properly. But for some reason, Azure doesn't return that 404 HTML page.

    These are the response headers that Azure returns for those weird 404 pages:

    -----

    HTTP/1.1 404 The requested content does not exist.
    Content-Length: 965
    Content-Type: text/html
    Server: Windows-Azure-Web/1.0 Microsoft-HTTPAPI/2.0
    x-ms-error-code: WebContentNotFound
    x-ms-request-id: 09cd7f22-301e-0017-15bd-dc569c000000
    x-ms-version: 2018-03-28
    Date: Thu, 06 Feb 2020 07:20:17 GMT

    -----

    Any idea what can cause this?

    Thanks in advance!

    Thursday, February 6, 2020 7:22 AM

Answers

  • Thanks for the reply and all the help.

    I luckily fixed the problem myself today. The software I used to upload my static website to Azure Blob Storage automatically gzips all HTML files.

    And that's a problem, since Azure doesn't support Gzip encoding for 404 pages (but it does for every other page). Sadly that feature isn't documented so I wasted an awful lot of time. Including your time.

    There is a feature request for Gzip support for 404 pages here: https://feedback.azure.com/forums/217298-storage/suggestions/37989187-gzip-encoding-for-404-document-in-static-website-h

    Perhaps if that gets implemented people don't run into this confusing error again.


    • Marked as answer by Jura4936 Tuesday, February 11, 2020 1:05 PM
    • Edited by Jura4936 Tuesday, February 11, 2020 1:06 PM
    Tuesday, February 11, 2020 1:05 PM

All replies

  • @Jura4936 I was able to repro the issue can you,please clear the cache of the browser or try the different browser and let me know the status. You can may also try Error document path and 404.html both as mentioned in the below screenshot.

     Additional information: Host a Static website. 

    Hope this helps! 

    Kindly let us know if the above helps or you need further assistance on this issue.
    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.

    Thursday, February 6, 2020 10:56 AM
  • Thanks for the reply!

    > please clear the cache of the browser or try the different browser and let me know the status.

    I cleared the cache of my browsers and tried again, but the same issue still happens. Is there something else I can try?

    Thursday, February 6, 2020 5:01 PM
  • @Jura4936 Can you run the URL again and press F12(Refer the the URL after launching the F12 page) and check what do see. I think you are getting 404 error 



    Friday, February 7, 2020 6:46 AM
  • Thanks for the reply!

    > Can you run the URL again and press F12(Refer the the URL after launching the F12 page) and check what do see. I think you are getting 404 error

    Yes, I get the 404 error. These are the returned headers:

    ------

    HTTP/1.1 404 The requested content does not exist.
    Content-Length: 1157
    Content-Type: text/html
    Server: Windows-Azure-Web/1.0 Microsoft-HTTPAPI/2.0
    x-ms-error-code: WebContentNotFound
    x-ms-request-id: 7d19135c-f01e-0008-06c2-dde598000000
    x-ms-version: 2018-03-28
    Date: Fri, 07 Feb 2020 14:23:52 GMT

    ------

    But this is not the problem. The problem is that Azure doesn't return the uploaded 404.html page when I make a 404 HTTP request.

    The documentation that you linked me says:

    > "The default error page is displayed when a user attempts to navigate to a page that does not exist in your static website."

    This doesn't happen; when I navigate to a non-existing page, Azure doesn't display my error page. Instead I get a weird looking text with all kinds of funny characters.

    Thanks for your help so far!

    Friday, February 7, 2020 2:26 PM
  • @Jura4936 Just for testing purpose can you make Internet explorer "Microsoft Edge" as your default browser and try. Let me know the status!

    Also try to reset the Other browsers. This issue is with the browser, may I know what is the language preference have you selected in the browsers? 

    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.


    Tuesday, February 11, 2020 9:28 AM
  • Thanks for the reply and all the help.

    I luckily fixed the problem myself today. The software I used to upload my static website to Azure Blob Storage automatically gzips all HTML files.

    And that's a problem, since Azure doesn't support Gzip encoding for 404 pages (but it does for every other page). Sadly that feature isn't documented so I wasted an awful lot of time. Including your time.

    There is a feature request for Gzip support for 404 pages here: https://feedback.azure.com/forums/217298-storage/suggestions/37989187-gzip-encoding-for-404-document-in-static-website-h

    Perhaps if that gets implemented people don't run into this confusing error again.


    • Marked as answer by Jura4936 Tuesday, February 11, 2020 1:05 PM
    • Edited by Jura4936 Tuesday, February 11, 2020 1:06 PM
    Tuesday, February 11, 2020 1:05 PM