1、如果是vue 运行npm run build
如果是nuxt 运行 npm run generate
打包dist 到根目录
2、在linux安装nginx进行映射
3、nginx.conf配置
server {
listen 8099;
#listen somename:8080;
server_name localhost;
#需注意 /api 要放到 /前面
location /api/{
proxy_pass http://XXXX:9201/; #XXXX为服务器IP
}
location / {
root /usr/project/dist; #为当前dist存放目录
index index.html login.htm;
}
}
4、启动redis
/usr/nginx/sbin/nginx -c /usr/nginx/conf/nginx.conf #nginx配置路径
原创文章,作者:1402239773,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/272246.html