Azure Static website react.js getting 404 in the browser but returning the correct content on a path

Dan Parker 101 Reputation points
2021-03-13T21:12:13.237+00:00

So like I normally setup static websites, with error page going back to index.html. The browser response shows a 404 though, on local it works ok and shows a 200. I'm not sure if this is an issue with the reactjs router or the azure static website configuration. Anyway to send this back as a 200
in my console shows

GET https://app.testsite.com/signup 404
Navigated to https://app.testsite.com/signup

and then works ok. Some browsers have issue with this as it shows red in the console

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,640 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
851 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dan Parker 101 Reputation points
    2021-03-14T17:42:46.94+00:00

    Ah, I see this is solved by a CDN rewrite rule, having this over the azure storage 404 redirect, I found this here,

    https://antbutcher.medium.com/hosting-a-react-js-app-on-azure-blob-storage-azure-cdn-for-ssl-and-routing-8fdf4a48feeb

    at the SpaRewriteRules

    1 person found this answer helpful.
    0 comments No comments