Forum Discussion

WTW_280077's avatar
WTW_280077
Icon for Nimbostratus rankNimbostratus
Aug 31, 2017

Route traffic based on use case

Is it possible to use iRule to route traffic to one pool when there is a file upload and other HTTP traffic to a default pool?

 

1 Reply

  • Hi WTW,

    Is it possible to use iRule...

    Everything is possible with iRules... 😉

    To develop a tailordered iRule for your Web Application, you have to find out how the upload functionality is implemented. Some Web Application are using a HTTP-POST request targeting a specific file (e.g.

    ./upload.php
    ) to upload the data and some others Web Applications are using the HTTP-PUT request (e.g. Webdav Clients).

    Depending on your Web Application an iRule may look like this:

    Example 1:

    when HTTP_REQUEST { 
        if { [string tolower [HTTP::path]] ends_with "upload.php" } then {
            pool upload_pool
        } else {
            pool default_pool
        }
    }
    

    Example 2:

    when HTTP_REQUEST { 
        if { [HTTP::method] equals "PUT" } then {
            pool upload_pool
        } else {
            pool default_pool
        }
    }
    

    Cheers, Kai