0

I use digital ocean space and CDN to host a React SPA. When hitting with a browser the url [host]/index.html it works fine. However hitting [host]/index.html/customers/one or any other subpaths, returns a 404. Currently, any reload on any subpath returns that 404. Last, I use terraform to update the SPA artifacts on DO spaces and I have tried to add a website_redirect="/index.html" to all the bucket objects (js, html and css) but with no success (more info if necessary here). And to be completely honest I am not sure I understand that option in the terraform digitalocean provider. I might be using it completely wrong.

Now, I have seen that question in multiple places but never with a clear answer.

Is there a way to achieve the mentioned goal of loading index.html for every route with DO space + CDN and let the app parse the rest of the path to display the right component subtree of the react app?

Andrea.cabral
  • 338
  • 3
  • 16
  • `[host]/index.html/customers/one` is a strange-looking path. It's not supposed to be something more like `[host]/customers/1`? – Noah Jun 16 '21 at 13:30
  • Indeed but I believe it is the same issue with digitalocean spaces/CDN. My index.html file, the entrypoint is also on the CDN. I initially thought I could serve it when hitting the root path but that is not a feature implemented in DO it seems. I feel like I am not gonna avoid bootstrapping a new droplet and setting it up there. – Andrea.cabral Jun 16 '21 at 16:05

0 Answers0