Forum Discussion
Mohamedabogamil
Nov 12, 2023Nimbostratus
URL edit
Dear I need to send the request as is to the backend server but the client should see another URI and shouldn't see the port number but the same time port number shouldn't be modified when f5 sends...
Hi Mohamedabogamil ,
Use this irule :
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/OA_HTML/"} {
HTTP::host [string map {":4443" ""}[HTTP::host]]
HTTP::uri [string map {"local" ""}[HTTP::uri]]
log local0. " the new URL >> [HTTP::host][HTTP::uri] "
}
}
Note : iRules consume CPU cycles , so keep your eyes in your system resourses for any spikes after applying this irule.
This irule should meet your requirements and here below the output from /var/log/ltm file
[root@bigipA:Active:Standalone] config # tac /var/log/ltm |grep -i "rule"
Nov 12 04:12:35 bigipA info tmm[16702]: Rule /Common/Replace <HTTP_REQUEST>: the new URL >> 10.1.10.35/OA_HTML/APPSLogn.jsp
[root@bigipA:Active:Standalone] config #
I hope you find this insightful 🙂
Nov 12, 2023
Mohamedabogamil ,
If you need to omit the removed parts in the URL from appearing in the browser,
I believe you can use redirection and clone the same Virual server but with the https /443 port.
here this editied irule :
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/OA_HTML/"} {
HTTP::host [string map {":4443" ""}[HTTP::host]]
HTTP::uri [string map {"local" ""}[HTTP::uri]]
log local0. " the new URL >> [HTTP::host][HTTP::uri] "
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects