Willy Tarreau | d1eb3f0 | 2007-09-18 19:52:58 +0200 | [diff] [blame] | 1 | # This is a test configuration. |
| 2 | # It must load-balance across active servers. Check local apache logs to |
| 3 | # verify : |
| 4 | # |
| 5 | # tail /var/log/apache/access_log |
| 6 | |
| 7 | |
| 8 | global |
| 9 | maxconn 10000 |
| 10 | |
| 11 | defaults |
| 12 | log 127.0.0.1:514 local0 |
| 13 | balance roundrobin |
| 14 | contimeout 3000 |
| 15 | srvtimeout 20000 |
| 16 | clitimeout 10000 |
| 17 | option dontlognull |
| 18 | |
| 19 | listen no_cookie |
| 20 | bind :8000 |
| 21 | retries 2 |
| 22 | redispatch |
| 23 | mode http |
| 24 | option httplog |
| 25 | balance roundrobin |
| 26 | server dead1 1.1.1.1:80 |
| 27 | server good1 127.0.0.1:80 |
| 28 | |
| 29 | # this one sends the connection to dead1, retries, then to good1, assigns |
| 30 | # the cookie. Subsequent connection will try to s1 again and should try good1. |
| 31 | listen cookie |
| 32 | bind :8001 |
| 33 | retries 2 |
| 34 | redispatch |
| 35 | mode http |
| 36 | option httplog |
| 37 | cookie SRV insert indirect nocache |
| 38 | balance roundrobin |
| 39 | server dead1 1.1.1.1:80 cookie s1 |
| 40 | server good1 127.0.0.1:80 cookie s1 |
| 41 | |
| 42 | # this one sends the connection to dead1, retries, then to good1, assigns |
| 43 | # the cookie. Subsequent connection will try to s1 again and will stick to it. |
| 44 | listen cookie_persist |
| 45 | bind :8002 |
| 46 | retries 2 |
| 47 | redispatch |
| 48 | option persist |
| 49 | mode http |
| 50 | option httplog |
| 51 | cookie SRV insert indirect nocache |
| 52 | balance roundrobin |
| 53 | server dead1 1.1.1.1:80 cookie s1 |
| 54 | server good1 127.0.0.1:80 cookie s1 |
| 55 | |
Willy Tarreau | a7e7614 | 2007-11-03 14:28:39 +0100 | [diff] [blame] | 56 | frontend frt_default_tcp |
| 57 | bind :8003 |
| 58 | mode tcp |
| 59 | option httplog |
| 60 | default_backend bck_default_tcp |
| 61 | |
| 62 | backend bck_default_tcp |
| 63 | mode tcp |
| 64 | option httplog |
| 65 | retries 2 |
| 66 | redispatch |
| 67 | balance roundrobin |
| 68 | contimeout 1000 |
| 69 | srvtimeout 25000 |
| 70 | server dead1 1.1.1.1:80 |
| 71 | server good1 127.0.0.1:80 |
| 72 | |
Willy Tarreau | d1eb3f0 | 2007-09-18 19:52:58 +0200 | [diff] [blame] | 73 | frontend frt_default |
| 74 | bind :8004 |
| 75 | mode http |
| 76 | option httplog |
| 77 | default_backend bck_default |
| 78 | |
| 79 | backend bck_default |
| 80 | mode http |
| 81 | option httplog |
| 82 | retries 2 |
| 83 | redispatch |
| 84 | balance roundrobin |
| 85 | contimeout 1000 |
| 86 | srvtimeout 25000 |
| 87 | server dead1 1.1.1.1:80 |
| 88 | server good1 127.0.0.1:80 |
| 89 | |
| 90 | frontend frt_use_back |
| 91 | bind :8005 |
| 92 | mode http |
| 93 | option httplog |
| 94 | use_backend bck_use_back if TRUE |
| 95 | |
| 96 | backend bck_use_back |
| 97 | mode http |
| 98 | option httplog |
| 99 | retries 2 |
| 100 | redispatch |
| 101 | balance roundrobin |
| 102 | contimeout 1000 |
| 103 | srvtimeout 25000 |
| 104 | server dead1 1.1.1.1:80 |
| 105 | server good1 127.0.0.1:80 |
| 106 | |