首页 > 解决方案 > 如何在 aws ec2 中使用 pm2 启动/运行 Angular 应用程序

问题描述

我在目录 /etc/nginx/conf.d 中有配置

`

server {
    listen 80;
    root /var/www/html/owner/dist/browser;
    server_name stagingapp.company.com;


location / {
    proxy_pass http://127.0.0.1:8002;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

我从本地系统构建了应用程序并推送到 Git。然后从 app 目录中的 Ec2 Server 中提取相同的内容。现在我想运行应用程序。我们对 PM2 有任何命令吗?

标签: angular

解决方案


与应用程序一起工作。

cd /var/www/my-demo-app ng build --prod --build-optimizer

*还要检查,sudo apt-get update sudo npm update


推荐阅读