Static Rewrite on 404 to API Service?

Hi, I’m experimenting with ideas around static sites and a separate backend service…the thing I’m wondering is if there’s a way to have a rewrite rule only apply to 404s. So for example:

/products/abc would work because it is part of the static build.

/products/xyz doesn’t exist, but upon 404 a rewrite rule kicks in to hit the backend service and return a page that does exist (or it could handle its own 404).

As far as I know from the docs, I can’t use a rewrite wildcard path that doesn’t interfere with existing static pages. Or can I?

Render static site doesn’t support rewrite by status code. You may be able to achieve a similar feature by client-side routing. For example, you can config client-side router to redirect all non-existing path to a specific error path and add a rewrite rule in Render’s static site to rewrite this error path to other backend service.

Not quite what I had in mind, but thanks for the clarification.