首页 > 编程知识 正文

nginx部署后端项目,多个nginx集群部署

时间:2023-05-05 22:10:12 阅读:252946 作者:3831

同域名同端口通过nginx location转发部署多个前端项目

项目编译需要增加二级目录 // react项目 通过配置basename增加二级目录 <BrowserRouter basename={`/h5/`}>{props.children}</BrowserRouter>// 也可以通过webpack 处理输出config.output.publicPath = '/h5/'; nginx配置多location转发 # 项目1 location / { root /data/html; index index.html index.htm; try_files $uri $uri/ /index.html; } # 项目2location /h5 { alias /data/report-h5/; index index.html index.htm; try_files $uri $uri/ /h5/index.html; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。