blob: 582a06967f5a2e0d869972e57ca242e5eaff0e44 [file] [log] [blame]
Willy Tarreaub463dfb2008-06-07 23:08:56 +02001# This is a test configuration.
2# It is used to check the redirect keyword.
3
4global
5 maxconn 400
6 stats timeout 3s
7
8listen 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 Tarreau79da4692008-11-19 20:03:04 +010020 acl url_test3 url_reg test3
Willy Tarreau0140f252008-11-19 21:07:09 +010021 acl url_test4 url_reg test4
22
23 acl seen hdr_sub(cookie) SEEN=1
24
Willy Tarreaub463dfb2008-06-07 23:08:56 +020025 redirect location /abs/test code 301 if url_test1
26 redirect prefix /pfx/test code 302 if url_test2
Willy Tarreau79da4692008-11-19 20:03:04 +010027 redirect prefix /pfx/test code 303 drop-query if url_test3
Willy Tarreaub463dfb2008-06-07 23:08:56 +020028
Willy Tarreaufe651a52008-11-19 21:15:17 +010029 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 Tarreau0140f252008-11-19 21:07:09 +010031
Willy Tarreaub463dfb2008-06-07 23:08:56 +020032 ### 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