# "Sorry page" and connection limits

**URL:** <https://community.a10networks.com/t/sorry-page-and-connection-limits/261>\
**Category:** aFleX\
**Created:** [February 26, 2014, 12:53pm UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261 "2014-02-26T12:53:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![PjarInk](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@PjarInk](https://community.a10networks.com/u/PjarInk)\
**Post date:** [February 26, 2014, 12:53pm UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/1 "2014-02-26T12:53:09Z")

</div>

Hello

I’ve been looking into 2 things, the first being a sorry page for when our servers are down and I’d like to have my page in the loadbalancer. Is aflex the best solution to this? To do a simple check if our SGs are down, display sorry page instead? Can the LB display HTML only or is it possible to have an image in there as well, or do I have to have the image off site? (Image is not necessary, just a bonus)

The other thing I’ve been looking into is related to the above in the sence that I want the same logic applied, but for connection limit. Please see my thread in general for more info: [https://www.a10networks.com/vadc/index.php/forums/topic/ax-handling-of-connection-limit/](https://www.a10networks.com/vadc/index.php/forums/topic/ax-handling-of-connection-limit/)

So basicly, I want to display the sorrypage when we’re receiving too many connections on our appservers to prohibit them from crashing due to overload.

---

<div class="post-metadata">

**Author:** ![kuma](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@kuma](https://community.a10networks.com/u/kuma)\
**Post date:** [February 27, 2014, 2:23am UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/2 "2014-02-27T02:23:20Z")

</div>

Hi Pierre,

Usually aFleX is the solution we would take if you want AX/Thunder to display sorry page. If you do have some other server which is capable of having sorry page contents, you can also use “failover-url” feature from HTTP template.

By having configuration like: slb template http myHTTP failover-url [www.example.com/contents/sorry.html](http://www.example.com/contents/sorry.html)

And apply it to the virtual server, then if all the member of service-group are down, the request will be redirected to the url configured.

Another part of your question: \>Can the LB display HTML only or is it possible to have an image in there as well, or do I have to have the image off site? (Image is not necessary, just a bonus)

You cannot have an image uploaded in the box. If you need to have an image to your sorry page displayed, you need to have it off site. Let’s wait for an enhancement for this part.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/a10_community/original/1X/bb9f186d33804d3044a0374e589f49fdf3be1328.png) [@system](https://community.a10networks.com/u/system)\
**Post date:** [February 27, 2014, 8:33am UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/3 "2014-02-27T08:33:43Z")

</div>

Hi Pierre,  
To get a image to display direct from the AX/TH

I used this site [http://yellowgreen.de/image-to-base64-string-encoder/language/en\_US/](http://yellowgreen.de/image-to-base64-string-encoder/language/en_US/) to encode a image file to base64, then use the following (removed some of the base64 as too long)

aFleX would be like the below.

when LB\_FAILED { HTTP::respond 503 content “Apology PageWe are sorry, but the site you are looking for is temporarily out of service  
If you feel you have reached this page in error, please try again.

”

}

Thanks Michael.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/a10_community/original/1X/bb9f186d33804d3044a0374e589f49fdf3be1328.png) [@system](https://community.a10networks.com/u/system)\
**Post date:** [February 27, 2014, 8:48am UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/4 "2014-02-27T08:48:31Z")

</div>

Sorry the Forum is converting the inline source image. (I will add spaces and see if that works).

hen LB\_FAILED { HTTP::respond 503 content “Apology PageWe are sorry, but the site you are looking for is temporarily out of service  
If you feel you have reached this page in error, please try again.

\<i m g s r c ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAVIAAACTCAIAAABTdAYdAAAAAXNSR0IArs4c6QAAbrpJREFUeF7tv…QmCC"/\>” }

---

<div class="post-metadata">

**Author:** ![PjarInk](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@PjarInk](https://community.a10networks.com/u/PjarInk)\
**Post date:** [February 27, 2014, 12:01pm UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/5 "2014-02-27T12:01:48Z")

</div>

Ok, thanks for input! I’ll try to make an aflex that covers our needs and I can post it here if there’s interest.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/a10_community/original/1X/bb9f186d33804d3044a0374e589f49fdf3be1328.png) [@system](https://community.a10networks.com/u/system)\
**Post date:** [February 27, 2014, 3:04pm UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/6 "2014-02-27T15:04:59Z")

</div>

Hi Pierre,  
&nbsp;&nbsp;&nbsp;&nbsp;Please do post what you come up with to help others.

Thanks  
Michael.

---

<div class="post-metadata">

**Author:** ![PjarInk](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@PjarInk](https://community.a10networks.com/u/PjarInk)\
**Post date:** [February 28, 2014, 8:37am UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/7 "2014-02-28T08:37:30Z")

</div>

Is it possible to store html in a variable? I can’t get it to work and I need it for my aflex to work properly.  
Right now it’s nothing more than a when LB\_FAILED and a http response with my page, but I need some more logic because we have a CDN on a different service group and I need to check if that group is up or down as well.

Another solution would be if it was possible to do something like:  
when LB\_FAILED or LB::status pool CDN == “down” {}  
But that doesn’t work either, I’ve tried a few different variations but without result.

---

<div class="post-metadata">

**Author:** ![PjarInk](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@PjarInk](https://community.a10networks.com/u/PjarInk)\
**Post date:** [February 28, 2014, 1:03pm UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/8 "2014-02-28T13:03:46Z")

</div>

I came up with a solution and it seems to work in my testing (disable realservers/service groups), the logic is that if any of our service groups are down, the sites function is degraded to a point where the site should not be displayed.

```auto
# Displays a sorry page when LB can not be performed (Servers down or connection limit hit)

when HTTP_REQUEST {
     if {([LB::status pool ServiceGroup1] equals "down") or ([LB::status pool ServiceGroup2] equals "down") or ([LB::status pool ServiceGroup3] equals "down")} {
         HTTP::respond 503 content "html goes here"
}
}

```

Please note that you have to escape quotation marks (") in the html response

---

<div class="post-metadata">

**Author:** ![kuma](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@kuma](https://community.a10networks.com/u/kuma)\
**Post date:** [March 4, 2014, 1:05am UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/9 "2014-03-04T01:05:43Z")

</div>

Thanks for the post.  
For putting HTML in variables, may be you can try out something like:

when RULE\_INIT {  
&nbsp;&nbsp;&nbsp;&nbsp;set ::myhtml “your html contents”

```auto
\}

when HTTP\_request\{ 

```

YOUR METHODS  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HTTP::respond 503 content $::myhtml  
}

---

<div class="post-metadata">

**Author:** ![PjarInk](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@PjarInk](https://community.a10networks.com/u/PjarInk)\
**Post date:** [March 4, 2014, 7:23am UTC](https://community.a10networks.com/t/sorry-page-and-connection-limits/261/10 "2014-03-04T07:23:54Z")

</div>

I got a blank page whenever I tried using a variable for my html.
