2017-04-17 82 views
0

我一直在爲我的angular2應用程序使用Nginx。現在我決定遷移到angular-CLI服務器。我面臨着設置Cookie的問題從NGINX移植到AngularCLI

在Nginx中,我使用proxy_cookie_path來定義cookie路徑。如何在角度CLI中執行此操作

server { 
     listen 80; 
     server_name "a2distribution-local.com"; 
     location/{ 
       root /Users/mypc/Documents/angular2Distribution/ ; 
       try_files $uri $uri/ /index.html =404; 
       } 
     location /rest/ { 
         proxy_set_header Host $host; 
         proxy_set_header X-Real-IP $remote_addr; 
         proxy_pass http://localhost:8080/cloudface/; 
         proxy_cookie_path /cloudface/ /; 
       } 
      } 

如何在角度CLI中實現此配置。

+0

角CLI是一個**的發展,只有**服務器。它不被用於生產。 –

+0

是的,我知道了。我只想要這些設置僅用於開發。在製作中我仍然使用Nginx。 –

+0

@JBNizet。有任何想法嗎。如何實現 –

回答