Forum Discussion
7 Replies
Sort By
- hooleylistCirrostratusIf you want an iRule that sends a canned HTTP response, you can use the HTTP::respond command (Click here).
when HTTP_REQUEST { HTTP::respond 200 "some html content" }
when HTTP_REQUEST { HTTP::redirect http://somehost.example.com }
- Striker_88408NimbostratusHmm ok ill try to explain a more what i'm looking for.
- hooleylistCirrostratusWhen a client makes a request for the VIP, 10.x.y.z, BIG-IP selects a node to send the request to. By default, the BIG-IP doesn't change the node's response headers or data. The node might be sending a redirect to the node's IP address. Or the node might be inserting a hardcoded reference to it's own IP address in the HTTP content.
- Striker_88408NimbostratusHello again,
- hooleylistCirrostratusCan you try this example to rewrite the Location header value to the fully qualified domain name that resolves to the VIP and see if this is what you're trying to achieve?
when HTTP_RESPONSE { if {[HTTP::is_redirect]}{ set virtual_ip [clientside {IP::local_addr}] set domain_name "host.example.com" set location [HTTP::header value Location] HTTP::header replace Location [string map [list $virtual_ip $domain_name] $location] log local0. "Updated Location header: [HTTP::header value Location]" } }
when HTTP_RESPONSE { if {[HTTP::is_redirect]}{ set domain_name "host.example.com" HTTP::header replace Location [string map [list [clientside {IP::local_addr}] $domain_name] [HTTP::header value Location]] } }
- hooleylistCirrostratusActually... I just reread what you wrote and I think I misinterpreted it.
- Striker_88408NimbostratusHello Aaron,