1、項目打包,在package.json中查看打包命令
2、運行打包命令
npm run build:prod
3、將打包後的dist文件的複製到nginx/html文件
4、配置conf/nginx.conf
server {
listen 8089;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location /prod-api/ {
root D:\nginx-1.17.10\html\dist;
proxy_pass http://localhost:9600/;
index index.html index.htm;
}
}