Forum Discussion
Need help on irule: External content for internal request in F5
Have you used log statements to verify expected variable inputs in each section of the iRule? That is the first thing I'd do.
Hi AubreyKing,
Thanks for your response.
While updating this irule, i got below messages...
01070151:3: Rule [/Common/irule-test] error: /Common/irule-test:4: error: [undefined procedure: internal_call_and_respond][internal_call_and_respond]
/Common/irule-test:7: error: [command is not valid in the current scope][proc internal_call_and_respond {} {
set backend_response [HTTP::get "https://www.myexternal.com"]
set response_status [HTTP::status]
set response_headers [HTTP::header]
}]
- PauliusAug 11, 2023MVP
grmanikantan Based on the log it seems like the subroutine isn't configured properly. Before we go any further with this, what's the requirement that is forcing you to have to take care of this on the F5?
- grmanikantanAug 11, 2023Altostratus
Hi Paul, My requirement is simple. There is one internal URL which is configured in F5 VS, if user hit that URL ( https://www.abcd.com ) F5 should be respond with external content (webpages) which is available in the outside of F5 (https://www.myexternal.com). I'm trying various methods subroutine is one of that...
- PauliusAug 11, 2023MVP
grmanikantan If you are just forwarding the content of that external site you might be better off configuring a pool with a pool member using the FQDN www.myexternal.com and then using a string map to replace instances of www.abcd.com with www.myexternal.com before it's set to the the destination. Keep in mind that you will have to enable SNAT for this to work most likely. The stringmap should look something like the following.
when HTTP_REQUEST priority 500 { if {[HTTP::uri] starts_with "/public/"} { HTTP::host [string map {"www.abcd.com" "www.myexternal.com"}[HTTP::host]] pool POOL_ExternalWeb_443 } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com