1
我有一個簡單的網站,使用angular
構建,我想在nginx
上部署。在nginx上部署Angular網站
我已經安裝在我的電腦nginx
和修改了根,如下nginx.conf文件的索引,
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location/{
root C:/Angular-Project/angular2-trial/src;
index index.html;
}
}
沒有,當我訪問localhost
,我得到的索引頁 - HTML內容,但它不能解決任何角度部分。並且在控制檯中沒有錯誤。
的Index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Angular2Trial</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
有沒有別的東西,我需要做的,使我的角度應用程序是功能?
非常感謝...正如你所說,我確實忘記了建立。建設它解決了我的問題 – Vinay
@Vinay:歡迎你:)你也可以upvote它:p –