Forum Discussion
Steve_87232
Nimbostratus
Aug 30, 2010ProxyPass - Reverse Proxy / Backend URL rewrite.
I have been trying to allow a user to type (for example) www.google.com in their browser, that then is sent to a virtual server on the LTM that sends the request to www.yahoo.com. The user sees the content of www.yahoo.com but their browser still shows www.google.com. So far I have had no luck in getting this going. I have looked at a number of iRules and not found one that meets my needs. ProxyPass seems to be the closest but I can not get it to work. I am a network guy and not a programmer so maybe I just don't get the iRule logic. Can anyone help me? The LTM needs to send traffic to that URL and resolve it via DNS as the site could change.
note, the URL is really more like what the user types: service.mycompany.com and it needs to redirect to externalsite.longurl.application.service.othercompany.com. Will need the LTM to change it on the way back too.
21 Replies
- Steve_87232
Nimbostratus
The external and internal URL are different of course but each of those will remain the same. - Steve_87232
Nimbostratus
Posted By Jason Rahm on 08/31/2010 09:52 AM
The functionality you are looking for is in the well documented proxypass iRule.
http://devcentral.f5.com/wiki/default.aspx/iRules/ProxyPass.html Click Here
As mentioned that is where I started but I could not get it to work. If that sounds like the correct iRule for what I need I will revisit it again. - The_Bhattman
Nimbostratus
Hi Steve,
If you decide to use the Proxypass and get stuck on something go ahead and use this forum to post your issue.
Thanks,
Bhattman - Steve_87232
Nimbostratus
Ok, I took a few days to move it back to proxypass and still can not get it to work. I have PoxyPass set to log and I see the log message but it alway just sends it to the pool I had to define and not to the website configured in my external file. Any tips on where I should look to resolve this? - Steve_87232
Nimbostratus
Logs. Changed a few things to mask a few items, VS=XYZ.
You can see it's hitting the iRule just not redirecting to the external url, just sending it to the pool I had to define.
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : XYZ: 10.64.2.18:62832 -> 10.64.196.100:80
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Found Rule, Client Host=brqa010.internalurl.com, Client Path=/, Server Host=web1qa.spsenet.externalurl.com, Server Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: New Host=web1qa.spsenet.externalurl.com, New Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Using default pool TEST_pool
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Removed Accept-Encoding header
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: $stream_expression_cmd: STREAM::expression "@web1qa.spsenet.externalurl.com/@brqa010.internalurl.com/@", $stream_enable_cmd: STREAM::enable
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Successfully configured and enabled stream filter
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Found Rule, Client Host=brqa010.internalurl.com, Client Path=/, Server Host=web1qa.spsenet.externalurl.com, Server Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: New Host=web1qa.spsenet.externalurl.com, New Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Using default pool TEST_pool
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Removed Accept-Encoding header
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: $stream_expression_cmd: STREAM::expression "@web1qa.spsenet.externalurl.com/@brqa010.internalurl.com/@", $stream_enable_cmd: STREAM::enable
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Successfully configured and enabled stream filter
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Found Rule, Client Host=brqa010.internalurl.com, Client Path=/, Server Host=web1qa.spsenet.externalurl.com, Server Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: New Host=web1qa.spsenet.externalurl.com, New Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Using default pool TEST_pool
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Removed Accept-Encoding header
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: $stream_expression_cmd: STREAM::expression "@web1qa.spsenet.externalurl.com/@brqa010.internalurl.com/@", $stream_enable_cmd: STREAM::enable
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/: Successfully configured and enabled stream filter
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/favicon.ico: Found Rule, Client Host=brqa010.internalurl.com, Client Path=/, Server Host=web1qa.spsenet.externalurl.com, Server Path=/
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/favicon.ico: New Host=web1qa.spsenet.externalurl.com, New Path=/favicon.ico
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/favicon.ico: Using default pool TEST_pool
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/favicon.ico: Removed Accept-Encoding header
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/favicon.ico: $stream_expression_cmd: STREAM::expression "@web1qa.spsenet.externalurl.com/@brqa010.internalurl.com/@", $stream_enable_cmd: STREAM::enable
Wed Sep 8 14:21:00 CDT 2010 info local/tmm tmm[5142] Rule ProxyPass : VS=XYZ, Host=brqa010.internalurl.com, URI=/favicon.ico: Successfully configured and enabled stream filter - Nik
Cirrus
did you ever get this to work? i'm having the same issue; the rule goes off but still sends my traffic to the default pool. - RajX_87248
Nimbostratus
Add me to this list..... Aaron gave me some suggestion for this but still not complete solution. Any luck for you guys ??
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1179347/showtab/groupforums/Default.aspx - Nik
Cirrus
i wasn't able to get anything working properly. we have a serveriron load balancer that does this natively, i'm disappointed that f5 hasn't implemented that same sort of functionality. - hoolio
Cirrostratus
Raj, I replied to your thread.
Nik, which LTM version are you running? Which version of the ProxyPass iRule are you testing? Can you post the config datagroup 'b class CLASS_NAME list', the debug logs from the iRule and a description of the failure?
Aaron - Nik
Cirrus
10.2 - it's been a few months since i've worked on it, can you direct me to the most recent proxypass rule before i start messing with this again?
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
