0

I am new to angular2. I have been using Nginx for my angular1. How to configure these settings in 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/  /;
4
  • You can still use nginx with angular 2. I dont know much about Nginx config, but if you describe what you're looking for maybe i can help you setup the angular cli server. Commented Apr 14, 2017 at 13:13
  • sure . @thanks. I need to set my angular CLI server for production.. Commented Apr 14, 2017 at 13:26
  • is it recommended to use angular cli server for production @AhmedMusallam Commented Apr 14, 2017 at 13:27
  • You should never use angular cli server for production. It's only meant as a dev server. If you are already using Nginx, keep using it for angular 2 as well for production. Commented Apr 14, 2017 at 13:27

2 Answers 2

2

There is a full guide available on the official documentation that explain everything you need to know to properly deploy your application on a production server. There is even a part dedicated to Nginx configuration.

I would also advise you to take profit of Angular-CLI to properly handling everything related to bundling, optimizing and AOT compilation.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank You so much. I will try that out
0

Angular-Cli is not for production. It is a development server. So these things are likely not necessary to set up in angular-cli. for backend proxy can be achieved by Setup Backend proxy

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.