PDA

View Full Version : Using URLSW Appliance to match parameter portion of URL


EricNielsen
06-29-2011, 04:57 PM
We want to use the URL switch to route incoming requrests.
Initially we thought that matching on "/element#/" in URLs like
//host/element1
//host/element2
//host/element3
would work. The URL switch does this no problems.
However, adding the "element#/" in the URI causes the java app server to mis-route the request once it gets to the right machine.

We tried matching on parameter values, e.g.:
matching on "elementId=element#" in the parameter list, and allowing all the URLs like
//host/<other-stuff>?elementId=element1
//host/<other-stuff>?elementId=element2
etc.

However, the URL Switch will not match on that part of the string.

Solutions?
Modify URLSW?
Use URL rewrite rules (ick)
other?

shivaguru
07-06-2011, 02:07 PM
Can someone please help us with this question?

PeterNic
07-07-2011, 12:23 AM
Eric, Shivaguru,

Alas, the type "url" is just that - URL, not the full URI which may contain a query string (and anchor). Adding parse type for the query string and for the anchor (e.g., //host/<path>#element1) would be a good idea. So, the right approach - if you cannot get the app server to deal with the additional path element - would be to modify URLSW and add a "query" type that will parse the query string after the question mark.

A quick - albeit not perfect - alternative is to use multiple hostnames that all map to the same IP address and use type=host:
//element1.host.com/<location>
//element2.host.com/<location>

I will also check with the developer of the URLSW if there is an easy fix/patch that will include the query string.

Best regards,
- Peter

EricNielsen
07-07-2011, 08:24 AM
Hostnames per internal vm break encapsulation, as well as scale badly.
So we'll need to find another way. Are there any appliances that do URL re-writes? This would not be pretty, but would work in our case without having to worry about re-writing retruned references.

PeterNic
07-07-2011, 08:44 AM
If you use WEB5 - or a derivative - you can put rewrite rules in the optional .htconf file, or the more modular .apache_conf directory.

Still checking for an easy fix for URLSW

Best regards,
- Peter