Search code examples
reactjsapachenext.jsproxypass

NextJS breaks when proxypass apache


I want to deploy my nextjs app to my server. i started server with "npm run start". it runs on localhost:3000. Then I proxypass localhost:3000 to domain of my website. I edited apache conf file like this:

enter image description here

and now when i go to my website from my domain I'm getting a lot of errors in console and app doesnt work well. functionality breaks. it fails to load chunks and show me in console "is true hostaname: false". I don't know what to do now. help, plz.


Solution

  • Pay attention there are many 404 on js files. enter image description here

    You need to add a mapping between _next/static -> .next/static folder.