Forum Discussion
Irule Vs rewrite - FQDN hostname
Hi Amine_Kadimi
Would I create 2 separate irules?
Sorry for the ambiguous reply. No you can do it with one iRule and one when HTTP_REQUEST block containing all the replacement logic you need.
Two iRules can work too but there is no need to go this way in your case.
- Mr__TFeb 23, 2023Cirrus
Ok copy. Let me try and report back.
- Mr__TFeb 23, 2023Cirrus
One last thing, there is a port needed for the pool side connection
- Mr__TFeb 23, 2023Cirrus
Below is what I have in 1 irule. Fails because the backend server is expecting---https://ServerName.Domain.com:8443/etc/bc/ui5_ui5/ui2/ushell/shells/abap/something.html"
But I want the client browser to have the below once the server completes its jobs post request.
https://FQDN/etc/bc/ui5_ui5/ui2/ushell/shells/abap/something.html
Hope this makes sense.
when HTTP_REQUEST {
# Check if requested host doesn't start with www.example.com
if {not ([string tolower [HTTP::host]] starts_with "https://FQDN/")}{# Replace the host header value with newhost.example.com
HTTP::header replace Host "https://ServerName.Domain.com:8443/"
if { [HTTP::uri] starts_with "/" } {
set uri [string map -nocase {"/" "/etc/bc/ui5_ui5/ui2/ushell/shells/abap/something.html"} [HTTP::uri]]
HTTP::uri $uri
}
}
}
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