Browse Source

modified: haproxy.cfg

jaikuai 6 months ago
parent
commit
caee94f985
1 changed files with 38 additions and 2 deletions
  1. 38 2
      haproxy.cfg

+ 38 - 2
haproxy.cfg

@@ -27,7 +27,18 @@ frontend web
     mode http
 	option accept-invalid-http-request
 	bind 0.0.0.0:443
-    default_backend open_baidu
+
+    acl open_baidu hdr(host) -i openapi.baidu.com
+    acl pan_baidu hdr(host) -i pan.baidu.com
+    acl pcs_baidu hdr(host) -i pcs.baidu.com
+    acl d_pcs_baidu hdr(host) -i d.pcs.baidu.com
+
+    use_backend open_baidu_backend if open_baidu
+    use_backend pan_baidu_backend if pan_baidu
+    use_backend pcs_baidu_backend if pcs_baidu
+    use_backend d_pcs_baidu_backend if d_pcs_baidu
+
+    default_backend open_baidu_backend
 
 backend ftp_be21
     balance leastconn
@@ -35,12 +46,30 @@ backend ftp_be21
     stick-table type ip size 100k expire 1h
     server ftp-server1 47.98.251.134 check port 21
 
-backend open_baidu
+backend open_baidu_backend
     mode http
     option forwardfor header X-Real-IP
 	option http-server-close
     server openbaidu openapi.baidu.com check port 443
 
+backend pan_baidu_backend
+    mode http
+    option forwardfor header X-Real-IP
+	option http-server-close
+    server server pan.baidu.com check port 443
+
+backend pcs_baidu_backend
+    mode http
+    option forwardfor header X-Real-IP
+	option http-server-close
+    server server pcs.baidu.com check port 443
+
+
+backend d_pcs_baidu_backend
+    mode http
+    option forwardfor header X-Real-IP
+	option http-server-close
+    server server d.pcs.baidu.com check port 443
 
 listen nvr
     bind *:200
@@ -69,3 +98,10 @@ listen registry
     option http-server-close
     mode tcp
     server zhl nas.fast-fun.cn:5000 check
+
+
+listen http_proxy
+    bind *:6667
+    option http-server-close
+    mode tcp
+    server zhl 	10.10.64.1:6667 check