Using Netlify CLI netlify dev, SSR routes work, redirects and headers apply, except Content-Security-Policy if present in netlify.toml, the server crashes and throws an error.
Netlify configuration redirects, headers only work on static (pre-rendered) routes, such as /static/ route for example.
Also, the custom /404 page does not handle not found routes in SSR, instead showing a blank page with the text Not Found (if you remove this page, Netlify uses its own default version).
So, if the problem is resolved, how would it be correct to move the user to the 404 page based on the query or search parameter:
if (Astro.params.project === "1577") {
return new Response(null, { status: 404 });
// return Astro.redirect("/404/");
}
.env:
AWS_LAMBDA_JS_RUNTIME=nodejs16.x
NODE_VERSION=16.19.0
stackblitz: https://stackblitz.com/github/predaytor/astro-ssr-netlify
deploy (using trailing slash):
https://luxury-capybara-511d8e.netlify.app/