首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >http http前端,后端

http http前端,后端
EN

Server Fault用户
提问于 2018-03-09 19:33:43
回答 1查看 545关注 0票数 0

我需要使用back来侦听端口80,并转发请求,如果它与我这样做的角色匹配,但我不知道如何才能告诉您如何使用先证者后端

代码语言:javascript
复制
frontend httpfw
bind *:80
mode http
acl # what I must write here to defend a domain like test1.com
acl # what I must write here to defend a domain like test2.com

use_backend httptest1 if # how can I told to use this backend if the request comes from test1.com
use_backend httptest2 if # how can I told to use this backend if the request come from test2.com

backend httptest1
mode http
balance source
server httptest1 1.1.1.1:80 



backend httptest2
mode http
balance source
server httptest2 2.2.2.2:80 

谢谢:)

EN

回答 1

Server Fault用户

回答已采纳

发布于 2018-03-09 19:52:40

在您提供的示例中,以下应该将流量路由到相应的后端:

代码语言:javascript
复制
## Look at host header
acl host_test1 hdr(host) -i test1.com
acl host_test2 hdr(host) -i test2.com

## figure out which one to use depending on the criteria above
use_backend httptest1 if host_test1
use_backend httptest2 if host_test2
票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/900923

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档