nginx - Nginx:第一个文件夹的通配符
问题描述
我正在努力创建一个使用动态文件夹名称的 Nginx 规则。我有 2 个应用程序:
app1: /
app2: /resident
他们的网址如下:
app1:
/dashboard
/login
app2:
/resident/dashboard
/resident/login
到目前为止,我设法让 Nginx 工作,发送/
到/var/www/app1
和发送/resident
到/var/www/app2
. 现在,我们需要在 URL 中添加客户名称。像这样:
app1:
/:customer/dashboard
/:customer/login
app2:
/:customer/resident/dashboard
/:customer/resident/login
将:customer
是一个变量,它仍应进入相同的文件系统文件夹:
/:customer/
=>/var/www/app1
和/:customer/resident
=>/var/www/app2
我尝试了不同的方法,不同的正则表达式/订单。没有成功。
解决方案
推荐阅读
- ios - WKwebView 在 iOS 应用程序中使用 WebPageProxy 错误代码 1003 间歇性地给出错误
- python - Pandas:创建新列,根据条件从另一行中查找和选择值
- reactjs - 为什么我的 SASS 项目不考虑媒体断点?
- azure - 在 Azure 但在非 AKS Kubernetes 环境/Kubernetes Baremetal 安装中需要 Azure CNI 的问题或帮助
- javascript - React Material-UI Select未检测到滚动事件
- linux - nix::sched::clone 在 println 后导致分段错误
- heroku - 从 Freenom 添加 Heroku 自定义域
- python - 为什么我会在这个“else”语句中得到“SyntaxError: 'invalid syntax'”?
- flutter - 协助业务逻辑
- android - 如何让我的 android 模拟器正确扩展?