Forum Discussion
URL edit
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]" } }
- MohamedabogamilNov 12, 2023Nimbostratus
Hi Mohamed thanks for the replay i will explain the problem in a better way
I need to send the request as is to the backend server
(The URL is https:example.com:4443/OA_HTML/APPSlocalLogn.jsp )
but the client should see another URI and shouldn't see the port number
(The URL is https:example.com/OA_HTML/APPSLogn.jsp )
but same time port number shouldn't be modified when f5 sends this request to the backend servers
did your solution match with this scenario
- M_SaeedNov 12, 2023Cirrus
- Nov 12, 2023
Hi Mohamedabogamil ,
Thanks for response and letting me know.
>> To change the URL in the browser page , you need to rely on redirection to make the URL appears like this ( https:example.com/OA_HTML/APPSLogn.jsp ) and this is what I did in the irule.
>> To deliver the request without modifications to Backend servers behind Bigip , you can do this using " HTTP_REQUEST_SEND " event , as it triggeres in server side connections prior to sending http requests to pool members.
What I am trying to say :
1- Do that modification , and use redirect >>> Client HTTP_REQUEST event.
2- Revert back all modifications under HTTP_REQUEST_SEND event , so you can send the request like this " <pool_member_IP>:4443/OA_HTML/APPSlocalLogn.jspSo I see first you need redirection to to change the sahpe of URL in the web browser.
Tell me if you agree on the redirection , I can complete the irule syntax and share it.
by the way , you can create another VS listen on port 443 to recieve the traffic after redirection and attach same pool "4443" and bigip will do destination port translation by default. after that you will attach the new irule that manuplates in server side requests within this VS.
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