If all of the servers host the content for all of the web application instances, it would be easiest in terms of BIG-IP configuration to have the instances on the same port on each web server. The web servers would use the host header in the client request to determine which instance answers the request.
With the servers configured like that, you could create a pool on the BIG-IP with all of the servers' IP and port. You could then create a virtual server which references the port. You wouldn't need an iRule to route the requests. This would work very simply for HTTP traffic.
If you need to support SSL for the web applications, you run into an issue with using a single HTTPS virtual server. If this is the case, check a related post on SANs for details (
Click here). If SANs aren't an option, and all of the sites are on the same domain, you could use a single wildcard cert to decrypt the HTTPS. Finally, if neither of these options work, you'd need to configure individual HTTPS virtual servers for each site which requires SSL decryption.
Aaron