Dynamic Routes when using a Reverse Proxy #11713
Unanswered
tankadesign
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a new NextJS project that I'd like to point to from a different domain and directory using a reverse proxy. So for instance, maindomain.com/path/site/ will point to the root at whatever.now.sh. And I have dynamic routes setup for all of the content, under page/[id].js. I have configured assetPrefix and used publicRuntimeConfig to get all of the assets loading correctly. The one issue is dynamic routing, as adding the base path prefix to the dynamic routes, while it sort of works, causes a hard page refresh and isn't loading the route via client side correctly.
My links are done via onClick like so:
router.push(
/?id=${id}
,${basePath}/page/${id}
, {shallow: true})getStaticPaths looks something like this:
index.js and page/[id].json share most of the same code, with the exception of getStaticPaths
My dynamic routes are built using the page/[id].js paradigm and getStaticPaths. Would just using exportPathMap in next.config.js make any bit of difference? What would cause a hard refresh to occur and not a client-side only route change?
Beta Was this translation helpful? Give feedback.
All reactions