-
1. Re: Query string truncation
vernoncrandall Jan 15, 2010 3:22 PM (in response to edwinb1)Have you found a solution to this problem? I am working on the same issue. Everything works except the query_string is dropped. I have tried adding rewrite rules without success as it truncates the query_string value out after the rewrite.It seems to be some kind of a limitation with the proxy balancer.
This will be a problem with our REST web services and the GET.
RewriteEngine On
RewriteLog "D:/bin/httpd-2.2/logs/rewrite_log"
RewriteLogLevel 9#tried all of these:
#RewriteRule "^(/.*)$" "proxy:balancer://av.biz.local$1?%{QUERY_STRING}" [QSA,L]
RewriteRule "^(/.*)$" "proxy:balancer://av.biz.local$1?%{QUERY_STRING}" [L]
#RewriteRule "^(/.*)$" "proxy:balancer://av.biz.local$1" [QSA,L]
ProxyPass / balancer://av.biz.local/ stickySession=JSESSIONID|jsessionidHere is the rewrite log with a simple example where the args added in then split back out.
127.0.0.1 - - [15/Jan/2010:13:12:35 --0700] [127.0.0.1/sid#10cf568][rid#15f4838/initial] (2) init rewrite engine with requested uri /ws/services/CapService
127.0.0.1 - - [15/Jan/2010:13:12:35 --0700] [127.0.0.1/sid#10cf568][rid#15f4838/initial] (3) applying pattern '^(/.*)$' to uri '/ws/services/CapService'
127.0.0.1 - - [15/Jan/2010:13:12:35 --0700] [127.0.0.1/sid#10cf568][rid#15f4838/initial] (2) rewrite '/ws/services/CapService' -> 'proxy:balancer://av.biz.local/ws/services/CapService?wsdl'
127.0.0.1 - - [15/Jan/2010:13:12:35 --0700] [127.0.0.1/sid#10cf568][rid#15f4838/initial] (3) split uri=proxy:balancer://av.biz.local/ws/services/CapService?wsdl -> uri=proxy:balancer://av.biz.local/ws/services/CapService, args=wsdl
127.0.0.1 - - [15/Jan/2010:13:12:35 --0700] [127.0.0.1/sid#10cf568][rid#15f4838/initial] (1) go-ahead with proxy request proxy:balancer://av.biz.local/ws/services/CapService [OK] -
2. Re: Query string truncation
edwinb1 Jan 18, 2010 2:32 AM (in response to vernoncrandall)Here's my latest attempt, and please do share your observations:
--- mod_cluster/native/mod_proxy/proxy_util.c (revision 135)
+++ mod_cluster/native/mod_proxy/proxy_util.c (working copy)
@@ -2063,8 +2063,8 @@
*/
/* are we connecting directly, or via a proxy? */
if (!proxyname) {
- *url = apr_pstrcat(p, uri->path, uri->query ? "?" : "",
- uri->query ? uri->query : "",
+ *url = apr_pstrcat(p, uri->path, r->args ? "?" : "",
+ r->args ? r->args : "",
uri->fragment ? "#" : "",
uri->fragment ? uri->fragment : "", NULL);
}Regards,
Edwin
-
3. Re: Query string truncation
vernoncrandall Jan 20, 2010 3:38 PM (in response to edwinb1)I see two possible solutions at this time: Modify mod_proxy or mangle the URL with the querystring and unmangle it on the back end.
I will reply when I have something tested.
The think that concerns me about changing mod_proxy is that the documentation clearly states that the query_string data will not be passed via ProxyPass but I haven't found a reason why this is the case on the internet. Is there a special reason for this limitation? I prefer HTTP POST commands for regular web pages but many REST web services rely on the query_string parameters for GET.
-
4. Re: Query string truncation
jfclere Jan 21, 2010 3:14 AM (in response to vernoncrandall)Changing ./modules/proxy/proxy_util.c is not a good idea because it is just a patched version of the ASF httpd one. -
5. Re: Query string truncation
vernoncrandall Jan 26, 2010 12:59 PM (in response to jfclere)I have found a configuration that will work with mod_cluster 1.0.3.GA but it will not work with 1.1.0 Beta1.
I added "nocanon" to ProxyPass and disabled all of the RewriteRules I was experimenting with.
ProxyPass / balancer://av.biz.local/ stickySession=JSESSIONID|jsessionid nocanon
I also tried a lot of variations with Proxy, ProxySet, and RewriteRules but this always truncated the query_string from the request. nocanon was only available using ProxyPass.
Exerpt from mod_proxy documentation:
ProxyPass [path] !|url [key=value key=value ...]] [nocanon] [interpolate]
Normally, mod_proxy will canonicalise ProxyPassed URLs. But this may be incompatible with some backends, particularly those that make use of PATH_INFO. The optional nocanon keyword suppresses this, and passes the URL path "raw" to the backend. Note that may affect the security of your backend, as it removes the normal limited protection against URL-based attacks provided by the proxy.
Thanks for all the suggestions.
-
6. Re: Query string truncation
jfclere Jan 28, 2010 2:59 AM (in response to vernoncrandall)I confirm that it is a bug in 1.1.x (MODCLUSTER-118).