Angular项目打包到nginx部署过程
一. 打包Angluar
ng build,会在项目文件夹下生成dist文件,里面是打包后的文件
二. 部署nginx
在nginx官网中下载nginx
把dist文件夹下的打包文件拷贝到nginx/html下并重命名为myProj
修改conf/nginx.conf文件
location / {
root html/myProj;
index index.html index.htm;
}
点击nginx.exe启动nginx
在浏览器中输入localhost:80即可看到项目