devs!
I'm trying to build a multilingual website based on Next.js(15.6) Node 22.21.10. Locally I have no issue with routing everything works as expected. Both lang versions are served as expected. (have toggle in header).
Navigation doing its job. site.com gives me correct lang version and if im switching to EN all pages are served correctly in English, however after deploying it to Digital Ocean droplet breaks it(Only front page all other pages are fine).
So my question is, is that a misconfiguration in Next or should I change something in DO droplet?
Sharing my middleware.ts
import createMiddleware from 'next-intl/middleware';
export default createMiddleware({
locales: ['ru', 'en'] as const,
defaultLocale: 'ru',
localePrefix: 'as-needed',
localeDetection: false,
});
export const config = {
matcher: ['/((?!_next|.*\\..*).*)'],
};
All my pages are in the app/[locale]/*.tsx (and subfolders for other pages)
I dont have any root page.tsx/layout.tsx
So, my question is what am I missing here?
Please, let me know if I should share more info/files
Thanks!
EDIT:
That happens only with main page. All other pages, categories, single items. e.g. site.com/items works as expected and serves right version
On the server I get 302 redirect on main page