Forum Discussion

ewest111's avatar
ewest111
Icon for Nimbostratus rankNimbostratus
Jul 17, 2015

Help with iRule to redirect to maintenance page with pool is down

I am trying to configure a static page to display if all nodes in a pool go down. I have imported my code into an iFile and I have applied that file to the iRule. elow is my iRule code.

 

when HTTP_REQUEST { if {[active_members [LB::server pool]] < 1} {

 

HTTP::respond 200 content [ifile get "down_html"] } }

 

When I apply the iRule as a resource I get an error that states unable to find ifile(down_html) referenced at line 3: [ifile get "down_html"] 

Any help would be greatly appreciated.

7 Replies

  • That worked, however it brought up another issue. As you can tell I'm new to the iRules world....I have two profiles for my server pool. One that serves HTTP and one that serves HTTPS. When I apply the above iRule on the https virtual server I get the following:

     

    01070394:3: HTTP_REQUEST event in rule (/Common/Cokes_Redirect) requires an associated HTTP or FASTHTTP profile on the virtual server (/Common/vs_testcokes_443).

     

  • Right. You need to apply an HTTP profile and client SSL profile to the HTTPS VIP to make this iRule work.

     

  • The only profile (client) that is in the drop down list id the FastL4

     

  • In order to use HTTP commands and events in an iRule, you need a virtual server type that support an HTTP profile (like the "Standard" type VIP). You must also terminate the SSL at the VIP with a client SSL profile (you can optionally re-encrypt).

     

  • Do you also have an HTTP profile applied to the HTTPS VIP? Is the backend server listening on HTTPS, and if so do you have a server SSL profile applied to the VIP as well?

     

    What happens if you remove the iRule (but leave it as a standard VIP with SSL profile(s))?

     

  • Okay, so understand that in this mode the VIP is acting as an SSL proxy. You're doing SSL between the client and the VIP, so you need a client SSL profile on the VIP to handle that communication. You're also doing SSL on the server side, between the BIG-IP and the server, so you need a server SSL profile as well. There are two separate SSL sessions here - one between the client and BIG-IP, and one between the BIG-IP and server, so you need a separate client side and server side SSL profile applied to the VIP. For the iRule to work, you also need an HTTP profile applied to the virtual server. In most versions it's the fourth option down in the virtual server config under the "Configuration" section.