首页 > 解决方案 > 如何在 ubuntu-nginx-server 中部署 nextjs?

问题描述

example.com我在使用dns托管的 ubuntu 服务器中的 nextjs-app 。我的 api 是从api.example.com. 我的 env.production 文件具有 NEXT_PUBLIC_MY_VAR 的必要字段。安装了所有必要的 npm 依赖项。我尝试了许多命令,例如构建,开始。我没有克服它。请帮助我找到一种正确的方法,在带有 nginx-web-server 的 ubuntu os 服务器上部署 nextjs 应用程序。

  1. 应该运行哪些命令来构建 nextjs 应用程序?
  2. nfginx 服务器呈现的根文件应该是什么?
  3. 我的 nginx 服务器配置应该是什么example.com

标签: next.js

解决方案


推荐阅读