Skip to content

Commit bfbf0ac

Browse files
committed
10.25 wrap up
1 parent c25f9a4 commit bfbf0ac

11 files changed

Lines changed: 5041 additions & 4986 deletions

co-pilot_irules_examples.irul

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,28 @@ when HTTP_RESPONSE {
6060
log local0. "http response: [IP::server_addr]:[TCP::server_port] -> [IP::client_addr]:[TCP::client_port] [HTTP::status] [HTTP::reason]"
6161
}
6262

63+
64+
# create an irule to forward traffic to pool based on uri
65+
cat <<EOF > /config/uri_pool.irule
66+
when HTTP_REQUEST {
67+
if { [HTTP::uri] starts_with "/example" } {
68+
pool www.example.com
69+
}
70+
elseif { [HTTP::uri] starts_with "/example2" } {
71+
pool www.example2.com
72+
}
73+
else {
74+
pool www.example.com
75+
}
76+
}
77+
78+
# create an irule to respond to a tcp connection with "got it"
79+
cat <<EOF > /config/tcp_got_it.irule
80+
when CLIENT_ACCEPTED {
81+
TCP::collect
82+
}
83+
84+
when CLIENT_DATA {
85+
TCP::release
86+
TCP::respond "got it"
87+
}

0 commit comments

Comments
 (0)