Migrating F5 iRules HTTP Redirects to RELIANOID Service Redirect Rules

View Categories

Migrating F5 iRules HTTP Redirects to RELIANOID Service Redirect Rules

1 min read

Overview #

This article explains how to migrate a simple F5 BIG-IP iRule used for HTTP redirects into RELIANOID using native HTTP/S farm service redirect features.

The original iRule redirects users accessing the root URI (/) to the /myapp path on the same host.

Original F5 iRule #

when HTTP_REQUEST {
    if { [HTTP::uri] equals "/"}
    {
        HTTP::redirect "https://[HTTP::host]/myapp"
    }
}

This logic performs:

  • URI inspection
  • Host preservation
  • HTTPS redirection
  • Path append operation

RELIANOID Migration Approach #

In RELIANOID, this functionality can be implemented natively through:

  • HTTP/S farm services
  • Host matching patterns
  • Redirect rules
  • Append or Absolute destination options

This eliminates the need for TCL/iRule scripting.

Recommended RELIANOID Configuration #

Configuration Goal #

When a client accesses:

https://example.com/

The load balancer redirects the client to:

https://example.com/myapp

Step 1: Create or Edit the HTTP/S Farm Service #

Navigate to Farms > HTTP/S Farm > Services

Step 2: Configure the Matching Criteria #

Use the service matching configuration to detect the desired request.

Host Match

Configure the Host matching pattern with the exact hostname if required, or empty for wildcard matching. Example: example.com

URI Match

Configure the URI matching rule: /. This ensures the redirect applies only to requests hitting the root path.

Step 3: Configure the Redirect Action #

In the service action section select Redirect.

Redirect Destination Options #

RELIANOID provides different redirect methods:

  • Append Path: Appends a path to the existing host
  • Absolute URL: Redirects to a fully qualified URL
  • Relative Redirect: Redirects using a relative URI

Recommended Option for This Migration #

For this iRule:

HTTP::redirect "https://[HTTP::host]/myapp"

The recommended RELIANOID configuration is:

Redirect Type: Append
Destination: /myapp

This preserves:

  • Original hostname
  • HTTPS scheme
  • Client-requested domain

Alternative: Absolute URL #

Alternatively, you can configure:

Redirect Type: Absolute URL
Destination: https://example.com/myapp

This is useful when:

  • Redirecting to another domain
  • Enforcing canonical URLs
  • Migrating applications

Validation #

After applying the configuration, test using:

curl -I https://example.com/

Expected response:

HTTP/1.1 301 Moved Permanently
Location: https://example.com/myapp

Browser Validation #

Open:

https://example.com/

Expected behavior:

Browser automatically redirects to:

https://example.com/myapp

Troubleshooting #

Redirect Not Triggering #

Verify:

  • Service matching rules are correct
  • URI exactly matches /
  • Host matching pattern is valid
  • Farm configuration has been applied

Redirect Loop #

Ensure:

  • /myapp is excluded from the redirect rule
  • Backend application does not perform additional conflicting redirects

HTTPS Not Preserved #

Verify:

  • Farm is configured as HTTPS
  • SSL certificates are installed correctly
  • Redirect configuration preserves scheme

Redirect Applies to All URLs #

This usually happens if the URI match is too broad.

Correct configuration should target / only.

Best Practices #

  • Prefer native redirect rules over scripting when possible
  • Use append mode for same-host application redirects
  • Use absolute redirects only when changing domains
  • Validate redirect behavior with both browser and CLI tools

Summary #

F5 iRules performing HTTP redirects can be migrated into RELIANOID using native HTTP/S service redirect rules without requiring scripting.

This approach simplifies configuration and improves maintainability while preserving equivalent redirect behavior.

📄 Download this document in PDF format #

    EMAIL: *

    Powered by BetterDocs