Forum Discussion
F5 irule for reverse proxy with rewrite
HTTP::header replace Host http://docs.remotesite.com
i think this one should not have http://
e.g.
HTTP::header replace Host "docs.remotesite.com"
My uri displayed in the browser stays at /templates/docs. I would like it to change to /templates/docs/index.html
you need HTTP::redirect to change url in browser.
HTTP::redirect
https://devcentral.f5.com/wiki/iRules.HTTP__redirect.ashx
It does seem to be pulling content from docs.remotesite.com but there are some javascript files from that page that are not being downloaded "GET" correctly.
in your irule, it does change host header, uri and send traffic to pool_docs pool only when uri is /templates/docs or /templates/docs/. does the javascript also need to?
- network_76_2027Jun 02, 2015
Nimbostratus
So there is no way to grab content from another server and rewrite the clients URL without redirect? Similar to the Apache or 'nginx' commands, rewrite and proxy_pass ? - nitass_89166Jun 02, 2015
Noctilucent
no, i think it is possible. what you need to do is to rewrite request and response properly. proxypass codeshare is one of examples. ProxyPass v10/v11 https://devcentral.f5.com/s/articles/proxypass-v10-v11 - network_76_2027Jun 03, 2015
Nimbostratus
I am running version BIG-IP 11.5.2 Build 0.0.141 Final When I copy and paste the ProxyPass code into my iRule and try to save I get an error, 01070151:3: Rule [/Common/rt18877] error: /Common/rt18877:1: error: [undefined procedure: @][@] If I remove the '@' from the beginning of the code, it will save the iRule, but I don't see any Proxy Pass activity while tailing logs. - network_76_2027Jun 03, 2015
Nimbostratus
Got Proxy Pass working with removing the '@' from the code. - network_76_2027Jun 03, 2015
Nimbostratus
Where in the iRule snippet can I place code to rewrite the client url path seen in their browser? I tried at the end of the HTTP_REQUEST event and somewhere in the middle of that same event. - nitass_89166Jun 03, 2015
Noctilucent
what did you find from troubleshooting?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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