Forum Discussion
chemaf_15095
Nimbostratus
Mar 22, 2010iRule to imitate rewrite with proxy [P]
Hi,
I need help with iRules to do the same as a rewrite of Apache, but with the proxy option [P].
I do not want to rewrite the url, all links must remain with the public URL and not the internal.
I've seen some examples of iRules but can not get that work well:
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=813039&view=topic
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=19947
Description of [L], [P] y [N] :
'proxy|P' (force proxy)
This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the proxy module. You must make sure that the substitution string is a valid URI (typically starting with http://hostname) which can be handled by the Apache proxy module. If not, you will get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map remote content into the namespace of the local server.
'last|L' (last rule)
Stop the rewriting process here and don't apply any more rewrite rules. This corresponds to the Perl last command or the break command in C. Use this flag to prevent the currently rewritten URL from being rewritten further by following rules. For example, use it to rewrite the root-path URL ('/') to a real one, e.g., '/e/www/'.
'next|N' (next round)
Re-run the rewriting process (starting again with the first rewriting rule). This time, the URL to match is no longer the original URL, but rather the URL returned by the last rewriting rule. This corresponds to the Perl next command or the continue command in C. Use this flag to restart the rewriting process - to immediately go to the top of the loop.
Also in case I need some parameters.
Here I put some examples:
1)
RewriteRule /aplication(.*) http://internal.server1.com/aplication/$1 [L,P]
2)
RewriteRule ^/myuri/(.*)\%2F(.*) /myuri/$1\%252F$2 [N]
RewriteRule ^/myuri(.*) http://internal.server2.com/myuri$1 [P]
Thanks,
- hoolio
Cirrostratus
You can use the ProxyPass or ProxyPass for LTM v10 to rewrite the host and/or URI (as opposed to redirecting the client).
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