Next js output: ‘export’ issue

My application is in Next js and my nex.config.js have the following params { output: ‘export’,}
when we are serving static build with nginx reverse proxy then for first time after login all the pages of my application are working fine but when i refresh on particular page then it redirects me to back to login page

i’m expecting is there the issue with how build is server as previously i was not using output export in next.cofig.js and it was directly served on server then this issue was not encountered so from code base may be this is not related.
i have tried to console and check my token after refresh and before too but token is always there in my application