Forum Discussion

dd007_132137's avatar
dd007_132137
Icon for Nimbostratus rankNimbostratus
Aug 23, 2013

Updating iRule doesn't reflect immediately?

Hi,

I am new to F5 and iRules world and I was trying some very basic iRule (copied below) that should redirect traffic to some website.

when HTTP_REQUEST {
  if {([string tolower [HTTP::host]] equals "myservice.api.abcd.com")} {
     HTTP::redirect "https://google.com"
  }
}


I am glad this worked but now when I try an example like below or even if I comment out the redirect with , it still redirects :(

when HTTP_REQUEST {
  if {([string tolower [HTTP::host]] equals "myservice.api.abcd.com")} {

   HTTP::respond 200 content "
            <html><head>
            <style type=\"text/css\">
            a { text-decoration:none }
            a:visited { text-decoration:none; }
            a:active { text-decoration:none; }
            a:hover { text-decoration:none; }
            </style>
            </head>
            <body link=\"blue\" alink=\"blue\" vlink=\"blue\">
            <body>
            <H2>helloz</H2>
            </body></html>
    "
   }
}

Does it take a while to actually reflect these changes or come in effect or am I doing something wrong? Please help.

Thank you.

5 Replies

  • I am sorry for the formatting of this post that seems messed up. It looked ok with the preview while typing it out though.
  • only new connections will see the changed iRule. If you have an existing browser window, close it (all iterations) and restart and you should see the change.

     

  • Hi dd007,

     

    When a client establishes a connect to a Virtual Server a "copy" of the currently applied iRules are tied to the clients connection. Once you disconnect that connection and establish a new connection you should see the changes.

     

    There is another thread that adds additional detail here:

     

    iRule changes not showing up

     

    Hope this helps.

     

  • Scott, I think I already updated the formatting. Looks like you combined the two code blocks into one. Oh well...