angular2 cli 中的 nginx 等效配置



我是 angular2 的新手。我一直在使用Nginx作为我的angular1。如何在 angular2-cli 中配置这些设置

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://localhost:8080/cloudface/;
proxy_cookie_path /cloudface/  /;

官方文档中提供了完整的指南,其中解释了在生产服务器上正确部署应用程序所需的所有信息。甚至还有一个专门用于Nginx配置的部分。

我还建议您利用 Angular-CLI 来正确处理与bundlingoptimizingAOT compilation相关的所有内容。

Angular-Cli 不用于生产。它是一个开发服务器。因此,这些东西可能没有必要在 angular-cli 中设置。后端代理可以通过设置后端代理来实现

{
  "/api": {
    "target": "http://localhost:3000",
    "secure": false
  }
}

最新更新