Rewriting subdomain.example.com to example.com/subdomain
I am deploying an Astro site with middleware and want to rewrite test.example.com to example.com/test, however it returns a 522 error.
I'm guessing it's getting stuck in a loop or something? Not sure how to handle this properly
3 Replies
O didn't know. Any recommendations on how to do this instead then?
So I would need 2 workers for this
Yeah it's Astro middleware
Basically trying to mimic something like this https://github.com/vercel/platforms/blob/main/middleware.ts
GitHub
platforms/middleware.ts at main · vercel/platforms
A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API. - vercel/platforms
I guess I can just do 2 workers