I got it to work. It looks like this right now:
when HTTP_REQUEST {
if { [HTTP::uri] ends_with ".exe"}{
set uri [HTTP::uri]
log "here1"
}
}
when HTTP_RESPONSE {
if {[HTTP::header "Content-Length"] >= 1048576 && [HTTP::header "Content-type"] contains "application" }{
HTTP::redirect "ftp://user1:useruser@192.168.0.1:21$uri"
log "here2"
}
}
The only problem is that before the download from FTP start it takes about 1 minute for BIG-IP to process (I'm using virtual edition). Logs are generated immidiately and I'm confused why redirect isn't sent immidiately too. After analysing tcpdump on server side it seems that BIG-IP is downloading whole file first before user is redirected to FTP server. How to fix it or how should I do this properly?
Please help me guys.