ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

How to failover to other forwarding host based on health check

book

Article ID: 173188

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

You have policy that uses forwarding host and you need to implement redundancy to  avoid single point of failure (SPOF).

In situation when health check fails for one forwarding host, proxy will fail over and use alternative uniform resource locator (URL) or IP address in other forwarding host.

Resolution

You have already one forwarding host configured "forwarding1", add another one and give it a similar name, for instance "forwarding2"

1. Create additional forwarding host

>Configuration>Forwarding>Forwarding>Host,

Alias: "forwarding2"

Host: IP address or URL

Depending on service type, select appropriate port number.

Now you have two forwarding host "forwarding1" and "forwarding2", verify if health check is ok for both of them:

>statistics>Health Checks> 

You should see "fwd.forwarding1" and "fwd.forwarding2" health checks.

 

2. Create forwarding rule

CPL

;;;;;;;;If first "forwarding1" health check is OK, use it;;;;;;;;
    "is_healthy.fwd.forwarding1"=yes forward("forwarding1") forward.fail_open(no)   

;;;;;;;;If first "forwarding1" health check is FAILED, forward to "forwarding2";;;;;;;;
    "is_healthy.fwd.forwarding1"=no forward("forwarding2") forward.fail_open(no)