Partial rewrites using nginx
Anyone here familiar with doing partial rewrites using nginx?
I have a setup with three containers:
- nginx
- legacy app (lives at www.example.com)
- new Next.js app
Requests to
www.example.com/new-feature
should use the Next.js app
When the Next.js app makes a request to www.example.com/new-feature/endpoint
, this should be handled by the legacy app.
I'd also like for the legacy app's cookie based auth to work in the Next.js app.
I'm sure someone has written a comprehensive article on this before, I just can't seem to figure out what to google for to find it.7 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
its a work project that is already deep on nginx
i'm trying to get buyin on a partial next.js rewrite, buyin on replacing nginx is almost certainly not realistic 😦
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
oh like use nginx rewrites to get requests from legacy to next, and next rewrites to get stuff from next back to legacy?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
is it feasible to have
/hew-feature/some-page
on next.js and /new-feature/api/get-something
on the legacy app this way?
i guess i could just call them different things to save myself some headacheUnknown User•3y ago
Message Not Public
Sign In & Join Server To View