在 IIS 中部署 Next Js 项目 [英] Deploying Next Js project in IIS

查看:65
本文介绍了在 IIS 中部署 Next Js 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目需要服务器端渲染.所以,我使用 next js 开发了它,现在我在部署中获得了 struct.

I had a requirement of server side rendering in my project.So, I have developed it using next js and now i got struct in deployment.

我需要在 iis 中部署我的项目,但不知道如何实现.我尝试了很多没有运气.它在开发模式下工作正常,但在生产模式下不工作.

I need to deploy my project in iis and dont know how i can achieve that. I tried a lot no luck. It works fine in development mode but not in production.

我尝试了 next export 但这是用于静态页面部署和我的项目使用动态页面.

I tried next export but this is for static pages deployment and my project uses dynamic pages.

任何帮助将不胜感激.提前致谢.

Any help will be appreciated. Thanks in advance.

推荐答案

试试这个 youtube 链接 它帮助我在 IIS 上部署了 nextjs 应用程序.不要忘记您的服务器上需要 NodeJS、URLRewrite 和 IISNode.

Try this youtube link it helped me deploy the nextjs app on IIS. Do not forget that you need NodeJS, URLRewrite and IISNode on your server.

您构建 nextjs 应用程序并将其部署到服务器上的 IIS 文件夹.您还需要包含所有依赖项的 node_modules 文件夹,包括 express 和 node.

You build your nextjs app and deploy it to the IIS folder on the server. You also need the node_modules folder with all the dependencies including express and node.

这篇关于在 IIS 中部署 Next Js 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆