Forum Discussion
Shivam_84461
Jul 21, 2015Nimbostratus
Using Apache ProxyPass Irule for reverseproxy
I am trying to replace my apache server which are currently working as reverseproxy server for one of our application. Instead of apache we want to to use F5 to do the same task.
The proxypass I...
daboochmeister
Jul 22, 2015Cirrus
I did Apache proxypass config for years, and have used the equiv iRule, to good effect - that said, in many situations you can get by with something much simpler.
- Create your SSL offload virtual server
- Define and add to the VS a stream profile, and define your string replacements there; if you have multiple replacements, use a regexp in the "Target" field only. See: https://support.f5.com/kb/en-us/solutions/public/8000/100/sol8115.html ... this will make replacements in both your headers and content returned. For help in formatting string replacements: https://devcentral.f5.com/articles/ltm-stream-profile-multiple-replacements-regular-expressions but make sure to check the previous link i provided, because some things change in v11, and more changes in v11.4
- If you're pre-11.4, make sure to set response processing in the HTTP profile to "rechunk"
Voila. Note this works if you don't need content-specific logic concerning what string replacements to make.
- Shivam_84461Jul 23, 2015NimbostratusHello daboochmeister, I tried this but this is not working. After attaching the stream profile to VS the page is not even replacing the url.
- daboochmeisterJul 23, 2015CirrusCan you describe what you mean, that the page is not replacing the URL? Couple of possibilities - I misspoke, the stream profile only makes replacements in returned content. To replace the URLs in any returned headers (e.g. Location headers associated with redirects), you can setup a Rewrite profile. Also, the stream profile replacements only work if you virtual has an HTTP profile as well (even just the default one, "http", is fine).
- Shivam_84461Jul 23, 2015NimbostratusNot replacing the URL means when I go to app.company.com its going to xyz.Salesforce.com..Like what a virtual server does. Just forwards the traffic to pool member. I'll try to attach both html profile and a rewrite profile.
- daboochmeisterJul 27, 2015CirrusI take what you're saying to mean that they access app.company.com, and in the results they get back, there are URL references to xyz.salesforce.com. If that's correct, can you identify where in the returned results these un-rewritten references to xyz.salesforce.com are? If they're in response headers (e.g., a Location: header associated with an HTTP status code 301/302 response), then the rewrite profile should do the replacement on those. If they are in actual content returned, then the stream profile isn't working ... either the stream profile isn't configured correctly, there's no http profile ... or the embedded xyz.salesforce.com URL is in content that maybe the stream profile can't find it/rewrite it (e.g., maybe it's buried in binary somewhere, a Java applet that's returned, or an ActiveX control?). If you're interested in pursuing this approach, can you pls post: - Your stream profile Source/Target fields - Your HTTP profile response chunking settings - Your Rewrite profile's settings - Response header and content output showing unrewritten xyz.salesforce.com URL (e.g., get this from Fiddler, or the browser Developer Tools with Network logging enabled, or HTTPWatch, etc.) Btw, what's your F5 environment (model, firmware version)?
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