如何在NextJS应用程序中使用Pm2作为不同的端口

问题描述 投票:0回答:1

我为我的 Nextjs 应用程序购买了 VPS 我使用 pm2 端口 3000 在我的 VPS 中托管了一个 NextJs 应用程序 现在我想在端口 3001 的同一 VPS 中托管另一个 NextJs 应用程序,网站显示 502 Bad Gateway nginx 错误 我尝试更改 pm2 中的端口

 pm2 start npm --name "app2" -- start Port  3001

但是仍然不起作用

Hostinger 的 VPS
操作系统 Ubuntu

nginx vps pm2
1个回答
0
投票

试试这个:

NODE_PORT=3001 pm2 start --name "app2" npm -- start 
© www.soinside.com 2019 - 2024. All rights reserved.