Forum Discussion
ProxyPass 10.5 URI rewrite failing
I am using LTM 10.2. I am attempting to use the ProxyPass 10.5 iRule located at https://devcentral.f5.com/wiki/iRules.proxypassv10.ashx. I am setting up a staging test environment for multiple websites on IIS 7.5. I only have one external IP to use and one SSL cert with the associated domain name (staging.externaldomain.com). I have IIS setup to use host headers (staging.realdomainname.com). I have the ProxyPass setup to map the sites the following way:
staging.externaldomain.com/realdomainname := staging.realdomainname.com
When I attempt to browse the site everything appears to work until I attempt to login, I get a 404 "The resource cannot be found.
The log on the F5 is:
Thu Oct 11 13:30:20 MST 2012 info local/tmm tmm[5347] Rule proxypass_irule : VS=Staging_https_virtual_server, Host=staging.externaldomain.com, URI=/realdomainname/welcome.aspx: Changing response header Location: /welcome.aspx?id=WEBTEST with /welcome.aspx?id=WEBTESTstaging.externaldomain.com/realdomainname
The URL I get back in the browser is staging.externaldomain.com/welcome.aspx?id=WEBTESTstaging.externaldomain.com/realdomainname
If I modify the returned URL to staging.externaldomain.com/realdomainname/welcome.aspx?id=WEBTEST I get a logged in page and can continue to use the site with no issues.
I have attempted to change the set static::RewriteResponsePayload. I have used 0, 1, and 2 with no change. Enabling and disabling the streamprofile also does not change this behavior.
Any help figguring this out would be appreciated.
Adam
4 Replies
- Adam_Borders_10
Nimbostratus
I enabled some additional logging.
Fri Oct 12 08:57:56 MST 2012 info local/tmm1 tmm1[5348] Rule proxypass_irule : VS=Staging_https_virtual_server, Host=staging.externaldomain.com, URI=/realdomainname/images/login.png: Found Rule, Client Host=staging.externaldomain.com, Client Path=/realdomainname, Server Host=staging.realdomainname.com, Server Path=
Thanks,
Adam
- hoolio
Cirrostratus
Hi Adam, - hoolio
Cirrostratus
Nevermind, this looks like a bug in this section of the iRule:383 Fix Location, Content-Location, and URI headers 384 foreach header {"Location" "Content-Location" "URI"} { 385 set protocol [substr [HTTP::header $header] 0 $host_serverside] 386 if {$protocol ne ""} { 387 set server_path [findstr [HTTP::header $header] $host_serverside [string length $host_serverside]] 388 if {$server_path starts_with $path_serverside} { 389 if { $static::ProxyPassDebug } { 390 log local0. "$log_prefix: Changing response header $header: [HTTP::header $header] with $protocol$host_clientside$path_clientside[substr $server_path [string length $path_serverside]]" 391 } 392 HTTP::header replace $header $protocol$host_clientside$path_clientside[substr $server_path [string length $path_serverside]] 393 } 394 } 395 }
- Adam_Borders_10
Nimbostratus
Hoolio-
Your 10.6 version fixed one of the issues I had with the iRule. Thanks a bunch.
I now am trying to fuggure out a way around the last issue I have. Our devs use a 302 redirect after page submission on a number of pages in the site. They only send back '/welcome.aspx?id=WEBTEST' or similar which bypasses the iRule re-write because the URL portion does not get included. This truncates the URL and URI on the client side to staging.externaldomain.com/welcome.aspx?id=WEBTEST instead of staging.externaldomain.com/internaldomain/welcome.aspx?id=WEBTEST.
Does anyone have any ideas on a way around this?
Thanks again for your help.
Adam
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