haproxy根据客户端浏览器进行跳转
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
根据手机端
acl iphone hdr_sub(user-agent) -i iphone
redirect prefix
if
iphone
acl android hdr_sub(user-agent) -i android
redirect prefix
if
android
根据访问后缀
acl test_pic path_end .gif .png .jpg .css .js
use_backend nginxpools
if
test_pic
根据访问开始路径来匹配
acl test_static path_beg
/html/
acl hd_dom hdr(Host) -i
test
.com
-i 忽略大小写
hdr是函数
method http方法
req_ver 请求版本
resp_ver 响应版本
status http状态
url 精确匹配url
url_reg 正则匹配
url_dir 斜线之间
url_dom 斜线之间或点之间
在haproxy匹配的时候根据use_backend先后顺序进行匹配
Haproxy健康检查方式
1.基于端口的健康检查方式
check port 80
2.基于http的
head
的ip url健康检查方式
option httpchk HEEAD
/health
.txt HTTP
/1
.0
server web1 192.168.1.2:80 maxconn 20480 weight 8 check inter 3000 fall 2 rise2
3.基于http的get的健康检查方式
option httpchk GET
/health
.txt
4.基于具体业务域名的URL健康检查
option httpchk HEAD
/index
.jsp HTTP
/1
.1\r\nHost:
option httpchk GET
/index
.jsp HTTP
/1
.1\r\nHost:www.
test
.com
haproxy中backup参数的使用
|
本文转自 rong341233 51CTO博客,原文链接:http://blog.51cto.com/fengwan/1689112

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
-
上一篇
Haproxy隐藏后端服务器信息、实现压缩、手机端跳转
1.隐藏后端服务器版本 在日常工作中我们都会使用haproxy作为负载均衡器,因为后端应用服务器多更改麻烦,因此决定在负载均衡器实现。 只需要再frondend或listen或backend,添加 1 2 3 4 5 rspidel^Server:.* rspidel^X-Forwarded-For:.* rspidel^X-Powered-By:.* rspidel^Via:.* rspidel^X-AspNet-Version:* 以上使用可参考rspidel. 另外如果需要迷惑一些人可根据需要添加响应头部,则可以使用rspadd. 1 rspaddServer:\AWS 2.Haproxy添加压缩功能(适用于Haproxy 1.5以上版本,1.4及以下版本不支持) 在global中添加 1 2 tune.comp.maxlevel9 #压缩级别 maxcompcpuusage50 #压缩最大可使用CPU资源为50% 在defaults中添加 1 2 3 compressionalgo gzip #压缩算法 compression type text /html...
-
下一篇
mobiscroll-2.17.1demo及源文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 <!DOCTYPEhtml> < html lang = "en" > < head &g...
相关文章
文章评论
共有0条评论来说两句吧...