In Reverse Proxy + Error Document, How Do You Get The OriginalRequest?

In Reverse Proxy + Error Document, How Do You Get The OriginalRequest?

am 17.12.2009 22:38:03 von Craig Riecke

--_000_588CEE9BADFEDE4FBF3C8EE4CD4CECFA1D39133056cxmail07adc xt_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I have Apache 2.2 set up as a reverse proxy, forwarding POST'ed packets to =
an internal server, getting the response, and sending it back. Everything =
works fine when no errors occur. To handle HTTP 500 error codes, I have co=
nfigured ProxyErrorOverride to replace the internal server's page with our =
own custom error. A Perl CGI script does that. And it works mostly fine.

But it looks like I have no access to the original packet. I'd like to log=
that request and send alerts. I have a lot of info available for the orig=
inal packet: for example $ENV{'Content-Length'} returns the size of it. Bu=
t when I try to read STDIN to get the actual content sent by the POST, lik=
e a regular ErrorDocument could do for locally-served CGI, I get nothing .

Any way around this?


--_000_588CEE9BADFEDE4FBF3C8EE4CD4CECFA1D39133056cxmail07adc xt_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" xmlns:p=3D"urn:schemas-m=
icrosoft-com:office:powerpoint" xmlns:a=3D"urn:schemas-microsoft-com:office=
:access" xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s=3D"=
uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs=3D"urn:schemas-microsof=
t-com:rowset" xmlns:z=3D"#RowsetSchema" xmlns:b=3D"urn:schemas-microsoft-co=
m:office:publisher" xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadshee=
t" xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" xmlns=
:odc=3D"urn:schemas-microsoft-com:office:odc" xmlns:oa=3D"urn:schemas-micro=
soft-com:office:activation" xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc=3D"http://m=
icrosoft.com/officenet/conferencing" xmlns:D=3D"DAV:" xmlns:Repl=3D"http://=
schemas.microsoft.com/repl/" xmlns:mt=3D"http://schemas.microsoft.com/share=
point/soap/meetings/" xmlns:x2=3D"http://schemas.microsoft.com/office/excel=
/2003/xml" xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" xmlns:ois=
=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir=3D"http://=
schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds=3D"http://www.w3=
..org/2000/09/xmldsig#" xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint=
/dsp" xmlns:udc=3D"http://schemas.microsoft.com/data/udc" xmlns:xsd=3D"http=
://www.w3.org/2001/XMLSchema" xmlns:sub=3D"http://schemas.microsoft.com/sha=
repoint/soap/2002/1/alerts/" xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#"=
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" xmlns:sps=3D"http://=
schemas.microsoft.com/sharepoint/soap/" xmlns:xsi=3D"http://www.w3.org/2001=
/XMLSchema-instance" xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/so=
ap" xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " xmlns:udc=
p2p=3D"http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf=3D"http:/=
/schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss=3D"http://sche=
mas.microsoft.com/office/2006/digsig-setup" xmlns:dssi=3D"http://schemas.mi=
crosoft.com/office/2006/digsig" xmlns:mdssi=3D"http://schemas.openxmlformat=
s.org/package/2006/digital-signature" xmlns:mver=3D"http://schemas.openxmlf=
ormats.org/markup-compatibility/2006" xmlns:m=3D"http://schemas.microsoft.c=
om/office/2004/12/omml" xmlns:mrels=3D"http://schemas.openxmlformats.org/pa=
ckage/2006/relationships" xmlns:spwp=3D"http://microsoft.com/sharepoint/web=
partpages" xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/20=
06/types" xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/200=
6/messages" xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ Sli=
deLibrary/" xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor tal=
Server/PublishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" xmlns:=
st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">


>









I have Apache 2.2 set up as a reverse proxy, forwardin=
g
POST’ed packets to an internal server, getting the response, and send=
ing
it back.  Everything works fine when no errors occur.  To handle =
HTTP
500 error codes, I have configured ProxyErrorOverride to replace the intern=
al
server’s page with our own custom error.  A Perl CGI script does
that.  And it works mostly fine.



 



But it looks like I have no access to the original
packet.  I’d like to log that request and send alerts.  I h=
ave
a lot of info available for the original packet: for example
$ENV{‘Content-Length’} returns the size of it.  But when I=
try
to read STDIN  to get the actual content sent by the POST, like a regu=
lar
ErrorDocument could do for locally-served CGI, I get nothing .  <=
/o:p>



 



Any way around this?



 









--_000_588CEE9BADFEDE4FBF3C8EE4CD4CECFA1D39133056cxmail07adc xt_--