【发布时间】:2016-02-27 17:40:56
【问题描述】:
想为代理网络请求添加动态虚拟主机和规则,如下所示
subdomain1.example.com/contexta => subdomain1.appservera.internal.host
subdomain1.example.com/contextb => appserverb.internal.host
subdomain1.example.com/contextc => appserverc.internal.host
subdomain2.example.com/contexta => subdomain2.appservera.internal.host
subdomain2.example.com/contextb => appserverb.internal.host
subdomain2.example.com/contextc => appserverc.internal.host
subdomain3.example.com/contexta => subdomain3.appservera.internal.host
subdomain3.example.com/contextb => appserverb.internal.host
subdomain3.example.com/contextc => appserverc.internal.host
广义的路由模式如下图所示。请求将被路由到的下游服务器是从服务器名称的前缀中获得的(尽管仅适用于某些上下文根)。
*.example.com/contexta => *.appservera.internal.host
*.example.com/contextb => appserverb.internal.host
*.example.com/contextc => appserverc.internal.host
理想情况下,当添加新的子域时,我们希望 Apache 配置保持不变。那可能吗?
我查看了Mass Virtual Hosting,但文档不清楚。
如果这不是一个简单的用例,nginx 会更有能力吗?
【问题讨论】: