综合网络各位大神的部署方案,终于在我自己电脑上成功部署。
记录在此,下次忘记再来看:
vue.config.js
打包后文件放在nginx下的html里面
nginx-1.16.0\conf下修改nginx.conf
server {
listen 8001;
server_name localhost;
location / {
root html;
try_files $uri $uri/ /MED/index.html;
index /MED/index.html;
}
location /api/ {
add_header 'Access-Control-Allow-Origin' '*';
proxy_pass http://192.168.20.46:8000/;
}
}
启动nginx