reactjs - NGINX 子目录后面的 ReactJS
问题描述
我有一个 ReactJS 应用程序正在运行,例如:192.168.0.111:12345
我有 NGINX 代理,我希望https://subdomain.domain.com/reactapp正确重定向到 192.168.0.111:12345 并将所有其他 URI 部分传递给它,除了 reactapp 字符串。
例如:
https://subdomain.domain.com/reactapp/home -> 192.168.0.111:12345/home
https://subdomain.domain.com/reactapp/statis/js/bundle.js -> 192.168.0.111:12345/static/js/bundle.js
我怎样才能配置 NGINX 像这样工作?
我试过这个:
location ~ ^/(reactapp/(.*)|(reactapp))$ {
proxy_pass http://192.168.0.111:12345/$1;
}
解决方案
推荐阅读
- flutter - Flutter 小部件对齐
- java - 如何使 charAt 方法与 java 中的数组一起使用?
- google-cloud-platform - 无法在谷歌数据实验室运行 pmdarima。它给出一个错误 .ufunc 大小改变,
- r - 数据框中的非英文字母
- python - 找到满足条件的连续元素 pandas
- c# - ASP NET Core WebSocket 接受延迟
- events - Spring集成事件的Spring集成顺序
- javascript - (javascript) JSON.parse() 改变 json 的内容
- javascript - 使用 redux 删除项目
- mysql - 如何过滤“SHOW BINLOG EVENTS”的输出