孤独750 发表于 2019-1-2 08:14:02

CDN调度器HAProxy、Nginx、Varnish

global  
    log         127.0.0.1 local2 debug
  

  
    chroot      /var/lib/haproxy
  
    pidfile   /var/run/haproxy.pid
  
    maxconn   8000
  
    user      haproxy
  
    group       haproxy
  
    daemon
  

  
    stats socket /var/lib/haproxy/stats
  

  
defaults
  
    mode                  http
  
    log                     global
  
    option                  httplog
  
    option                  dontlognull
  
    option http-server-close
  
    option forwardfor       except 127.0.0.0/8
  
    option                  redispatch
  
    retries               3
  
    timeout http-request    10s
  
    timeout queue         1m
  
    timeout connect         10s
  
    timeout client          1m
  
    timeout server          1m
  
    timeout http-keep-alive 10s
  
    timeout check         10s
  
    maxconn               8000
  

  
frontendmain *:5000
  
    acl geo_A1 src -f /etc/haproxy/conf/A1.subnets
  
    acl geo_AX src -f /etc/haproxy/conf/AX.subnets
  
    acl geo_BW src -f /etc/haproxy/conf/BW.subnets
  
    acl geo_CX src -f /etc/haproxy/conf/CX.subnets
  
    acl geo_FJ src -f /etc/haproxy/conf/FJ.subnets
  

  
    ...
  

  
    reqrep ^([^\ ]*)\ /(.*)\ HTTP    \1\ /\2&ipfrom=A1\ HTTP if geo_A1
  
    reqrep ^([^\ ]*)\ /(.*)\ HTTP    \1\ /\2&ipfrom=AX\ HTTP if geo_AX
  
    reqrep ^([^\ ]*)\ /(.*)\ HTTP    \1\ /\2&ipfrom=BW\ HTTP if geo_BW
  
    reqrep ^([^\ ]*)\ /(.*)\ HTTP    \1\ /\2&ipfrom=CX\ HTTP if geo_CX
  
    reqrep ^([^\ ]*)\ /(.*)\ HTTP    \1\ /\2&ipfrom=FJ\ HTTP if geo_FJ
  

  
    ...
  

  
    default_backend             static
  

  
backend static
  
    server      static 127.0.0.1:6081 check


页: [1]
查看完整版本: CDN调度器HAProxy、Nginx、Varnish