windows下若依vue项目部署

  1. 下载若依项目,前端后端项目本地启动
  2. 前端打包,后端打包
  3. 配置nginx.conf
    需要注意的是:路径别用中文,要不然报错
conf 复制代码
#前台访问地址及端口80,在vue.config.js中可查看
    server {
        listen       80;
        server_name  localhost;
#后台访问地址http://localhost:8080/
        location /prod-api/{
           proxy_set_header Host $http_host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header REMOTE-HOST $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           # proxy_pass就是设置的代理后的地址,即自己服务器后台接口的url
           proxy_pass http://localhost:8080/;
        }
 # root:dist静态页面根目录地址  index:dist中html文件的名字
         location / {
            root   C:/Users/18427/Desktop/windowsBUSHUTest/dist;
            try_files $uri $uri/ /index.html;
            index  index.html index.htm;
        }

# windows中无需配置第一行的user
  1. 启动nginx,访问localhost:80
    参考:
相关推荐
代码续发3 分钟前
自定义指令
javascript·vue.js·ecmascript
star learning white16 分钟前
xm C语言12
服务器·c语言·前端
tabzzz16 分钟前
大道至简:万字漫谈前端性能监控
前端·javascript·性能优化
0思必得024 分钟前
[Web自动化] CSS基础概念和介绍
前端·css·python·自动化·html·web自动化
小胖霞26 分钟前
全栈系列(15)github Actions自动化部署前端vue
前端·node.js·github
未来魔导26 分钟前
基于 Gin 框架的 大型 Web 项目推荐架构目录结
前端·架构·gin
Irene199127 分钟前
Vue 3 项目创建方式对比(npm create vue@latest -- --typescript --eslint --prettier 自带格式化)
vue.js
foundbug9991 小时前
Modbus协议C语言实现(易于移植版本)
java·c语言·前端
Luna-player1 小时前
在前端中list.map的用法
前端·数据结构·list
用户47949283569151 小时前
面试官问 React Fiber,这一篇文章就够了
前端·javascript·react.js