# Maintence

**URL:** <https://community.f5.com/t/maintence/21651>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [August 15, 2005, 2:50pm UTC](https://community.f5.com/t/maintence/21651 "2005-08-15T14:50:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Bond\_1573](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Chris\_Bond\_1573](https://community.f5.com/u/Chris_Bond_1573)\
**Post date:** [August 15, 2005, 2:50pm UTC](https://community.f5.com/t/maintence/21651/1 "2005-08-15T14:50:35Z")

</div>

Currently we’re looking todo the following:

BIG-IP → SSL Off Load/Compression → BIG-IP Chooses best WEB Server to route request to (WMI CPU, Dynamic Ratio from initial talks). F5/ada are doing this for us on the trial period.

Its also worth meantioning the ssl setup, we’re using two wildcard SSL Cert’s.

However, we have the following scenerio that we’d like to do on the big-ip side and was wondering if anybody has a solution.

Say we want to upgrade a customers site [https://clientname.domain.com/somevirtualdir/\](https://clientname.domain.com/somevirtualdir/%5C)\*. What we want todo is get the BIG-IP to stop sending those requests (which ever page they hit) over the normal webserver pool and instead redirect to a static htm page that says an upgrade is going on. Once the upgrade is finished we then want to revert back to the normal setup.

Hope this makes sense - im assuming its an irule and a combination of a vbs/.NET exe script to create an irule on the fly that disables takes priority over existing rules.

---

<div class="post-metadata">

**Author:** ![bl0ndie\_127134](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bl0ndie\_127134](https://community.f5.com/u/bl0ndie_127134)\
**Post date:** [August 15, 2005, 3:52pm UTC](https://community.f5.com/t/maintence/21651/2 "2005-08-15T15:52:36Z")

</div>

This rule should do the trick.

```tcl
when HTTP_REQUEST {
  if {[HTTP::host] equals "mydownhost.com" } {
      HTTP::redirect "http://www.mystatic.com/static.html"
  }
}

```

---

<div class="post-metadata">

**Author:** ![Chris\_Bond\_1573](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Chris\_Bond\_1573](https://community.f5.com/u/Chris_Bond_1573)\
**Post date:** [August 15, 2005, 3:56pm UTC](https://community.f5.com/t/maintence/21651/3 "2005-08-15T15:56:49Z")

</div>

What about a specifical directory too? As one site might have X amount of databases/sites hanging off it.

Are they any examples of creating the irule on the fly via the Web Services? Do we have to be careful about placement ie. this rule needs to take priority over the other rules if it exists.

---

<div class="post-metadata">

**Author:** ![bl0ndie\_127134](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bl0ndie\_127134](https://community.f5.com/u/bl0ndie_127134)\
**Post date:** [August 15, 2005, 4:19pm UTC](https://community.f5.com/t/maintence/21651/4 "2005-08-15T16:19:26Z")

</div>

You should be able to get that path information using the ‘HTTP::uri’; I would recommend that you scan around the forum as there are plenty of good examples that should get you statted.

As for configuration on the fly; we have a SOAP/XML interface called iControl that allows you to configure and modify configurations programmatically. Here is a link to its forum [Click here](http://devcentral.f5.com/default.aspx?tabid=28&view=topics&forumid=1)

Rules are specific to virtuals, therefore you can add/remove/modify a rule on virtual without affecting your other customers assuming that they are using different virtual addresses.

---

<div class="post-metadata">

**Author:** ![Colin\_Walker\_12](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Colin\_Walker\_12](https://community.f5.com/u/Colin_Walker_12)\
**Post date:** [August 15, 2005, 4:51pm UTC](https://community.f5.com/t/maintence/21651/5 "2005-08-15T16:51:24Z")

</div>

As for a rule using a redirect that includes the HTTP::uri, bl0ndie’s right, there are some good examples.

Here’s one [Click here](http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=3695)

-Colin

---

<div class="post-metadata">

**Author:** ![unRuleY\_95363](https://avatars.discourse-cdn.com/v4/letter/u/58f4c7/32.png) [@unRuleY\_95363](https://community.f5.com/u/unRuleY_95363)\
**Post date:** [August 15, 2005, 6:32pm UTC](https://community.f5.com/t/maintence/21651/6 "2005-08-15T18:32:11Z")

</div>

I might suggest you use a class/datagroup. That way you can dynamically update the class with hosts/uris that are offline and then you don’t have to change the rule.

IE:

```tcl
when HTTP_REQUEST {
   if { [matchclass [HTTP::host] equals $::offline_hosts] or \
        [matchclass [HTTP::uri] starts_with $::offline_uris] } {
      HTTP::redirect http://www.domain.com/offline
   }
}

```

You can then manage the offline\_hosts and/or offline\_uris datagroups via the GUI or iControl and it will dynamically take effect.

You can also use priorities to specify that this rule always runs first.

To do that, you add a priority statement with a number between 1-1000.

If you add the statement before the when statement, then that is the default priority for all subsequent when statements. IE:

```tcl
priority 250
when HTTP_REQUEST {
}

```

You can alternatively specify the priority after the event name in the when statement. In this case, the priority is changed only on that event. IE:

```tcl
when HTTP_REQUEST priority 250 {
}

```

This will make sure the this rule event runs before any other rule event with higher numbered priority. The default priority is 500.

---

<div class="post-metadata">

**Author:** ![Chris\_Bond\_1573](https://avatars.discourse-cdn.com/v4/letter/c/a88e4f/32.png) [@Chris\_Bond\_1573](https://community.f5.com/u/Chris_Bond_1573)\
**Post date:** [August 16, 2005, 4:42pm UTC](https://community.f5.com/t/maintence/21651/7 "2005-08-16T16:42:43Z")

</div>

Brilliant thanks for all your replies should be able to knock something up on unit now when it arrives.
