Willy Tarreau | b463dfb | 2008-06-07 23:08:56 +0200 | [diff] [blame] | 1 | # This is a test configuration. |
| 2 | # It is used to check the redirect keyword. |
| 3 | |
| 4 | global |
| 5 | maxconn 400 |
| 6 | stats timeout 3s |
| 7 | |
| 8 | listen sample1 |
| 9 | mode http |
| 10 | retries 1 |
| 11 | option redispatch |
| 12 | timeout client 1m |
| 13 | timeout connect 5s |
| 14 | timeout server 1m |
| 15 | maxconn 400 |
| 16 | bind :8000 |
| 17 | |
| 18 | acl url_test1 url_reg test1 |
| 19 | acl url_test2 url_reg test2 |
Willy Tarreau | 79da469 | 2008-11-19 20:03:04 +0100 | [diff] [blame] | 20 | acl url_test3 url_reg test3 |
Willy Tarreau | 0140f25 | 2008-11-19 21:07:09 +0100 | [diff] [blame] | 21 | acl url_test4 url_reg test4 |
| 22 | |
| 23 | acl seen hdr_sub(cookie) SEEN=1 |
| 24 | |
Willy Tarreau | b463dfb | 2008-06-07 23:08:56 +0200 | [diff] [blame] | 25 | redirect location /abs/test code 301 if url_test1 |
| 26 | redirect prefix /pfx/test code 302 if url_test2 |
Willy Tarreau | 79da469 | 2008-11-19 20:03:04 +0100 | [diff] [blame] | 27 | redirect prefix /pfx/test code 303 drop-query if url_test3 |
Willy Tarreau | b463dfb | 2008-06-07 23:08:56 +0200 | [diff] [blame] | 28 | |
Willy Tarreau | fe651a5 | 2008-11-19 21:15:17 +0100 | [diff] [blame] | 29 | redirect prefix / code 302 set-cookie SEEN=1 if url_test4 !seen |
| 30 | redirect location / code 302 clear-cookie SEEN= if url_test4 seen |
Willy Tarreau | 0140f25 | 2008-11-19 21:07:09 +0100 | [diff] [blame] | 31 | |
Willy Tarreau | b463dfb | 2008-06-07 23:08:56 +0200 | [diff] [blame] | 32 | ### unconditional redirection |
| 33 | #redirect location https://example.com/ if TRUE |
| 34 | |
| 35 | ### parser must detect invalid syntaxes below |
| 36 | #redirect |
| 37 | #redirect blah |
| 38 | #redirect location |
| 39 | #redirect location /abs/test |
| 40 | #redirect location /abs/test code |
| 41 | #redirect location /abs/test code 300 |
| 42 | #redirect location /abs/test code 301 |
| 43 | #redirect location /abs/test code 304 |
| 44 | |
| 45 | balance roundrobin |
| 46 | server act1 127.0.0.1:80 weight 10 |
| 47 | option httpclose |
| 48 | stats uri /stats |
| 49 | stats refresh 5000ms |