I have an Angular app that is currently server-side rendered by .Net Core. I want to change my build process to prerender almost all of my site and push all the static files to an Amazon S3 bucket and point my domain name there instead. However, I cannot prerender all of my website (at least not yet).
I found how I can return my index.html for any pages which are not prerendered and don't exist in the S3 bucket, which will allow me to client-side render the page, but I want to take it a step further and server-side render the page on-the-fly.
Is there a way I can use the S3 site as a reverse proxy that will fetch the SSR page from my .Net Core site if the prerendered version does not exist?
Update: Just to be clear, the S3 bucket will be for a CloudFront CDN, so setting up a proxy in front of the S3 bucket probably isn't an option.
Update 2: I found I can deliver dynamic content via CloudFront, but I don't want everything to be dynamic. I want any static content (like my prerendered pages) to be served from a cheap S3 bucket and only serve dynamic content from my more expensive EC2 instance if the static version doesn't exist.