Slide 107
Slide 107 text
119
when CLIENT_ACCEPTED {
set domain "?" ; # e.g. www.example.com
set addr "?" ; # e.g. 10.0.1.2.3
set port "?" ; # e.g. 80, 443, 8080
} ; # CLIENT_ACCEPTED
when HTTP_PROXY_REQUEST {
# Get domain name
# e.g. http://www.example.com/ => www.example.com
# e.g. http://1.1.1.1/ => 1.1.1
set domain [string tolower [URI::host [HTTP::uri]]]
if {[regexp {^([0-9]{1,3}[.]){3}[0-9]{1,3}$} $domain]} { ; # IPv4 address pattern
set addr $domain
} else {
# Get DNS A record
set result [RESOLV::lookup -a $domain]
set addr [lindex $result 0] ; # Get 1st DNS A record
}
# Get port number
# iRules URI::port command returns 80/443 for empty http/https port
# e.g. http://www.example.com/ => 80
# e.g. https://www.example.com/ => 443
set port [URI::port [HTTP::uri]]
# Jump to SSL Forward Proxy Virtual Server
# TODO: Specify Virtual Server name in your environment
virtual "VS_SSL_FORWARD_PROXY" $addr $port
} ; # HTTP_PROXY_REQUEST
when HTTP_REQUEST {
# Jump to SSL Forward Proxy Virtual Server
# TODO: Specify Virtual Server name in your environment
virtual "VS_SSL_FORWARD_PROXY" [HTTP::proxy addr] [HTTP::proxy port]
} ; # HTTP_REQUEST
HTTP Forward Proxyに適用するiRules