You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are deploying a website example.com with nextjs behind nginx where the example.com/api route is redirected to another server, this means we are unable to access nextjs own api routes, is there a configuration to change the default api route name?
Would adding a basepath solve the problem? so that the entire website becomes example.com/base/ and next apis would be example.com/base/api
Would it work to redirect to api in next.config.js?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are deploying a website
example.com
with nextjs behind nginx where theexample.com/api
route is redirected to another server, this means we are unable to access nextjs own api routes, is there a configuration to change the default api route name?Would adding a basepath solve the problem? so that the entire website becomes
example.com/base/
and next apis would beexample.com/base/api
Would it work to redirect to api in next.config.js?
Is any of these an officially supported solution?
Beta Was this translation helpful? Give feedback.
All reactions