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
    参考:
相关推荐
kyriewen115 小时前
你点的“刷新”是假刷新?前端路由的瞒天过海术
开发语言·前端·javascript·ecmascript·html5
摇滚侠5 小时前
JAVA 项目教程《苍穹外卖-12》,微信小程序项目,前后端分离,从开发到部署
java·开发语言·vue.js·node.js
skywalk81636 小时前
Kotti Next的tinyfrontend前端模仿Kotti 首页布局还是不太好看,感觉比Kotti差一点
前端
RopenYuan8 小时前
FastAPI -API Router的应用
前端·网络·python
_MyFavorite_8 小时前
JAVA重点基础、进阶知识及易错点总结(28)接口默认方法与静态方法
java·开发语言·windows
走粥9 小时前
clsx和twMerge解决CSS类名冲突问题
前端·css
Purgatory0019 小时前
layui select重新渲染
前端·layui
weixin1997010801610 小时前
《中国供应商商品详情页前端性能优化实战》
前端·性能优化
chushiyunen10 小时前
audacity软件实现音频处理
windows