Welcome! Log In Create A New Profile

Advanced

Proxy Closing Connection on "&&&" Characters

Posted by k_brady 
Proxy Closing Connection on "&&&" Characters
February 03, 2014 10:01AM
Hello, I have a problem using proxies, this happens in both nginx and apache.
I have a tomcat app that runs on port 8081, it validates messages (HL7V2) input on to
a screen. If I access the application (Directly) by http://hostname:8081/app it works fine.

When I run thru a proxy(as I said, I tried apache and nginx, same results)
http://proxyname and proxy pass it to http://hostname:8081/app when
a user has three ampersands (&&&) in the message, the proxy closes the connection
and nothing gets sent back. As I said, if I do it to the tomcat address directly it works fine,
only when I run it thru a proxy do I get the error.
Apache Error log:

[Thu Jan 16 12:16:07.516359 2014] [proxy:debug] [pid 29647:tid 139938968319744] proxy_util.c(2072): [client 129.6.59.5:55756] AH00944: connecting http://hit-dev.nist.gov:8081/mu-lab/faces/index.xhtml to hit-dev.nist.gov:8081, referer: http://dev-hl7v2-lab-testing.nist.gov/mu-lab/
[Thu Jan 16 12:16:07.516373 2014] [proxy:debug] [pid 29647:tid 139938968319744] proxy_util.c(2206): [client 129.6.59.5:55756] AH00947: connected /mu-lab/faces/index.xhtml to hit-dev.nist.gov:8081, referer: http://dev-hl7v2-lab-testing.nist.gov/mu-lab/
[Thu Jan 16 12:16:07.516766 2014] [proxy_http:error] [pid 29647:tid 139938968319744] (104)Connection reset by peer: [client 129.6.59.5:55756] AH01095: prefetch request body failed to 127.0.0.1:8081 (hit-dev.nist.gov) from 129.6.59.5 (), referer: http://dev-hl7v2-lab-testing.nist.gov/mu-lab/
[Thu Jan 16 12:16:07.516956 2014] [proxy:debug] [pid 29647:tid 139938968319744] proxy_util.c(2035): AH00943: HTTP: has released connection for (hit-dev.nist.gov)
[Thu Jan 16 12:16:07.517284 2014] [headers:debug] [pid 29647:tid 139938968319744] mod_headers.c(870): AH01503: headers: ap_headers_error_filter()
[Thu Jan 16 12:16:07.521274 2014] [authz_core:debug] [pid 29649:tid 139939196675840] mod_authz_core.c(828): [client 129.6.59.5:55757] AH01628: authorization result: granted (no directives), referer: http://dev-hl7v2-lab-testing.nist.gov/mu-lab/

nginx Error Log:
014/01/30 17:11:46 [debug] 11502#0: *58 http read client request body
2014/01/30 17:11:46 [debug] 11502#0: *58 recv: fd:10 1896 of 2786
2014/01/30 17:11:46 [debug] 11502#0: *58 http client request body recv 1896
2014/01/30 17:11:46 [debug] 11502#0: *58 http client request body rest 2786
2014/01/30 17:11:46 [debug] 11502#0: *58 recv: fd:10 -1 of 890
2014/01/30 17:11:46 [debug] 11502#0: *58 recv() not ready (11: Resource temporarily unavailable)
2014/01/30 17:11:46 [debug] 11502#0: *58 http client request body recv -2
2014/01/30 17:11:46 [debug] 11502#0: *58 http client request body rest 2786
2014/01/30 17:11:46 [debug] 11502#0: *58 event timer add: 10: 60000:1391119966408
2014/01/30 17:11:46 [debug] 11502#0: *58 http finalize request: -4, "/mu-lab/faces/index.xhtml?" a:1, c:2
2014/01/30 17:11:46 [debug] 11502#0: *58 http request count:2 blk:0
2014/01/30 17:11:46 [debug] 11502#0: *58 post event 0000000001461330
2014/01/30 17:11:46 [debug] 11502#0: *58 delete posted event 0000000001461330
2014/01/30 17:11:46 [debug] 11502#0: *58 http run request: "/mu-lab/faces/index.xhtml?"
2014/01/30 17:11:46 [debug] 11502#0: *58 http read client request body
2014/01/30 17:11:46 [debug] 11502#0: *58 recv: fd:10 -1 of 890
2014/01/30 17:11:46 [info] 11502#0: *58 recv() failed (104: Connection reset by peer), client: 129.6.59.5, server: dev-hl7v2-lab-testing.nist.gov, request: "POST /mu-lab/faces/index.xhtml HTTP/1.1", host: "dev-hl7v2-lab-testing.nist.gov", referrer: "http://dev-hl7v2-lab-testing.nist.gov/"
2014/01/30 17:11:46 [debug] 11502#0: *58 http client request body recv -1
2014/01/30 17:11:46 [debug] 11502#0: *58 http finalize request: 400, "/mu-lab/faces/index.xhtml?" a:1, c:1
2014/01/30 17:11:46 [debug] 11502#0: *58 http terminate request count:1
2014/01/30 17:11:46 [debug] 11502#0: *58 http terminate cleanup count:1 blk:0
2014/01/30 17:11:46 [debug] 11502#0: *58 http posted request: "/mu-lab/faces/index.xhtml?"
2014/01/30 17:11:46 [debug] 11502#0: *58 http terminate handler count:1
2014/01/30 17:11:46 [debug] 11502#0: *58 http request count:1 blk:0

I think it has to do with the & character and URLs, but if I put 1 in "&", it works, it put two in "&&" it works, i put three in "&&&" it fails. They are being encoded correctly, in the body I see "%26%26%26" which is the correct ascii encoding, so it shoul not be itnerpreted as a URL, any Ideas?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready