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
    参考:
相关推荐
+VX:Fegn089517 小时前
计算机毕业设计|基于springboot + vue蛋糕店管理系统(源码+数据库+文档)
前端·数据库·vue.js·spring boot·课程设计
Nicander19 小时前
我给 Excalidraw 做了一个本地工作区:DrawSpace
前端·开源
linux_cfan20 小时前
17 · 引擎适配器全景:HLS/DASH/Vimeo/Mux/Cast
前端·javascript·音视频
计算机魔术师21 小时前
烧掉2780亿美元还不够?OpenAI的资本豪赌让人头皮发麻
前端
IT_陈寒1 天前
Java线程池用错参数,我的服务居然悄悄崩溃了
前端·人工智能·后端
卡布鲁1 天前
React useMemo 与 useCallback 完全指南:原理、场景与避坑
前端·react.js
kakakahahahaha1 天前
Windows Steam 游戏存档在哪里?定位和恢复排查流程
windows·其他·电脑·笔记本电脑·内容运营·软件需求
Xy-unu1 天前
Windows 开启外接显示器 HDR 后外接显示器无信号、无法扩展模式故障记录
windows
碳基修炼1 天前
排查记:本地 devServer 是 http,浏览器却把 302 重定向升级成了 https
前端·http
步行cgn1 天前
Spring p 命名空间注入详解
java·前端·spring