F5 XC vk8s open source nginx deployment on RE

Code is community submitted, community supported, and recognized as ‘Use At Your Own Risk’.

Short Description

 

This an example for F5 XC virtual kubernetes (vk8s) workload on Regional Edges for rewriting the URL requests and response body.

 

 

Problem solved by this Code Snippet

 

The XC Distributed Cloud rewrite option under the XC routes is sometimes limited in dynamically replacing a specific sting like for example to replace the string "ne" with "da" no matter where in the url the string is located.

 

location ~ .*ne.* {

rewrite ^(.*)ne(.*) $1da$2;
}

 

Other than that in XC there is no default option to replace a string in the payload like rewrite profile in F5 LTM or iRule stream option.

 

sub_filter 'Example' 'NIKI';
sub_filter_types *;
sub_filter_once off;

 

 

Open source NGINX can also be used to return custom error based on the server error as well:

 

error_page 404 /custom_404.html;

location = /custom_404.html {
return 404 'gangnam style!';
internal;
}

 

How to use this Code Snippet

 

 

Read the description readme file in the github link and modify the nginx default.conf file as per your needs.

 

 

Code Snippet Meta Information

  1. Version: 1.25.4 Nginx
  2. Coding Language: nginx config

 

Full Code Snippet

 

https://github.com/Nikoolayy1/xc_nginx/tree/main

Updated Apr 01, 2024
Version 2.0

Was this article helpful?

1 Comment

  • Also the open source NGINX can be used to return custom error based on the server error 😉

     

    error_page 404 /custom_404.html;

    location = /custom_404.html {
    return 404 'gangnam style!';
    internal;
    }