For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

marvn_58503's avatar
marvn_58503
Icon for Nimbostratus rankNimbostratus
Mar 04, 2013

Problem with F5 Lync reverse proxy irule

Hi all,

I'm using the F5 Deployment Guide for Lync iApp in v11, and I'm looking at the irule provided in the documentation here: http://www.f5.com/pdf/deployment-guides/microsoft-lync-iapp-dg.pdf

See page 23, I'm using this:

when HTTP_REQUEST {
    switch [string tolower [HTTP::host]] {
         chat.example.com { pool front_end_pool }
         www.example.com {
         switch [string tolower [HTTP::uri]] {
              /meet { pool front_end_pool }
              }
         }
         www.example.com {
         switch [string tolower [HTTP::uri]] {
              /dialin { pool front_end_pool }
              }
         }
         lyncdiscover.example.com { pool front_end_pool }
    }
}

However when I visit www.example.com/meet or www.example.com/dialin, the irule doesn't match the URI.

I've edited the irule to add a debug statement, so now it looks like this:

when HTTP_REQUEST {
    switch [string tolower [HTTP::host]] {
        chat.example.com {
            log local0. "[IP::client_addr]:[TCP::client_port]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
            pool front_end_pool }
        www.example.com {
            log local0. "[IP::client_addr]:[TCP::client_port]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
            switch [string tolower [HTTP::uri]] {
                /meet {
                    log local0. "[IP::client_addr]:[TCP::client_port]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
                    pool front_end_pool }
            }
        }
        www.example.com {
            log local0. "[IP::client_addr]:[TCP::client_port]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
            switch [string tolower [HTTP::uri]] {
                /dialin {
                    log local0. "[IP::client_addr]:[TCP::client_port]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
                    pool front_end_pool }
            }
        }
        lyncdiscover.example.com {
            log local0. "[IP::client_addr]:[TCP::client_port]: [string tolower [HTTP::host]][string tolower [HTTP::uri]]"
            pool front_end_pool }
    }
}

When I tail -f /var/log/ltm it gives me "www.example.com" at the appropriate place but does not give me the statement with the URI inside the switch statements for /meet and /dialin.

Where am I going wrong? I copied this exactly out of the deployment guide.

All help appreciated.

6 Replies

  • I would've thought it could logically be compressed into the same evaluation, but that's how it comes in the deployment guide (and is what the iapp generates also) so I have to assume it can work?

     

     

    I've also got a case open with technical support asking why the switch statement doesn't seem to be matching, so we'll see what they say.
  • Using code from this thread https://devcentral.f5.com/community/group/aft/2166131/asg/50 I've managed to fix the issue.

     

    I have updated my thread with technical support, hopefully it can go in their knowledgebase and indeed the documentation can be fixed.

     

     

    My irule now looks like this:

     

    EDIT: Formatting got messed up, not sure how. I've had to provide further replies in the thread with the CODE.

     

  • When not using Lync Director

    
    when HTTP_REQUEST {
        switch [string tolower [HTTP::host]] {
            chat.example.com { pool front_end_pool }
            www.example.com {
            switch -glob [string tolower [HTTP::uri]] {
                "/meet*" { pool front_end_pool }
                }
             
                "/dialin*" { pool front_end_pool } 
                }
            }
            lyncdiscover.example.com { pool front_end_pool }
        }
    }
    
  • When using Lync Director

    
    when HTTP_REQUEST {
        switch [string tolower [HTTP::host]] {
            chat.example.com { pool front_end_pool }
    dir.example.com { pool director_pool }
            www.example.com {
            switch -glob [string tolower [HTTP::uri]] {
                "/meet*" { pool director_pool }
                }
             
                "/dialin*" { pool director_pool }
                }
            }
            lyncdiscover.example.com { pool front_end_pool }
        }
    }
    
  • Note on both of the above entries there is an extra } on the line after "/meet*" which is not required, however when I go to edit the above it mangles up the code box so I can't fix them.