本文介绍了当proxypass apache时NextJS中断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的 nextjs 应用程序部署到我的服务器.我用npm run start"启动了服务器.它在 localhost:3000 上运行.然后我将 localhost:3000 代理传递到我网站的域.我像这样编辑了 apache conf 文件:

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:

现在当我从我的域访问我的网站时,我在控制台和应用程序中遇到了很多错误.功能中断.它无法加载块并在控制台中向我显示是 true hostaname: false".我现在不知道该怎么办.帮助,请.

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.

推荐答案

注意 js 文件中有很多 404.

Pay attention there are many 404 on js files.

您需要在 _next/static -> .next/static 文件夹之间添加映射.

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

这篇关于当proxypass apache时NextJS中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 11:34