Jump to content

reverse proxy w/mod_rewrite adding unwanted headers & wrappers


NtroP

Recommended Posts

I hope this is an appropriate place to ask this question...

We have an Apache 2.2.2 server with mod_rewrite and mod_rewrite_html as a revers proxy for a Jetty server behind our firewall.  This works well for most things but parts of the Jetty application use some sort of flash/ajax-type communication for "real-time" status updates - particularly for running queries and reports (it notifies people their reports are done, etc.).

The problem is that the proxy server is adding extra headers and "wrappers" which break the messages going to the flash objects.  In particular it adds: [tt]charrset=utf-8..Keep-Alive:.timeout=5,.max=100..Connection:.Keep-Alive..[/tt]  and the converts the body of the message to [tt]<html><body><p>[i]message body goes here[/i]</p></body></html>[/tt]

Here is part of a tcpdump from the proxy:

[tt]        0x0000:  4500 01c9 50b9 4000 3d06 57ca d873 7e65  E...P.@.=.W..s~e
        0x0010:  0acd 3206 0050 09c6 ed7a c111 912f 4148  ..2..P...z.../AH
        0x0020:  8018 0707 cccf 0000 0101 080a 6c7d 0567  ............l}.g
        0x0030:  053e 3e07 4854 5450 2f31 2e31 2032 3030  .>>.HTTP/1.1.200
        0x0040:  204f 4b0d 0a44 6174 653a 2046 7269 2c20  .OK..Date:.Fri,.
        0x0050:  3034 2041 7567 2032 3030 3620 3230 3a32  04.Aug.2006.20:2
        0x0060:  333a 3331 2047 4d54 0d0a 5365 7276 6572  3:31.GMT..Server
        0x0070:  3a20 4a65 7474 792f 342e 322e 3230 2028  :.Jetty/4.2.20.(
        0x0080:  5769 6e64 6f77 7320 3230 3033 2f35 2e32  Windows.2003/5.2
        0x0090:  2078 3836 206a 6176 612f 312e 342e 325f  .x86.java/1.4.2_
        0x00a0:  3038 290d 0a43 6f6e 7465 6e74 2d54 7970  08)..Content-Typ
        0x00b0:  653a 2074 6578 742f 6874 6d6c 3b63 6861  e:.text/html;[color=blue]cha[/color]
        0x00c0:  7273 6574 3d75 7466 2d38 0d0a 4b65 6570  [color=blue]rset=utf-8..Keep[/color]
        0x00d0:  2d41 6c69 7665 3a20 7469 6d65 6f75 743d  [color=blue]-Alive:.timeout=[/color]
        0x00e0:  352c 206d 6178 3d31 3030 0d0a 436f 6e6e  [color=blue]5,.max=100..Conn[/color]
        0x00f0:  6563 7469 6f6e 3a20 4b65 6570 2d41 6c69  [color=blue]ection:.Keep-Ali[/color]
        0x0100:  7665 0d0a 5472 616e 7366 6572 2d45 6e63  [color=blue]ve..[/color]Transfer-Enc
        0x0110:  6f64 696e 673a 2063 6875 6e6b 6564 0d0a  oding:.chunked..
        0x0120:  0d0a 3963 0d0a 3c68 746d 6c3e 3c62 6f64  ..9c..[color=blue]<html><bod[/color]
        0x0130:  793e 3c70 3e31 3031 3030 3a46 494e 4953  [color=blue]y><p>[/color]10100:FINIS
        0x0140:  4845 443a 4269 7274 6864 6179 2052 6570  HED:Birthday.Rep
        0x0150:  6f72 740a 3130 3039 393a 4649 4e49 5348  ort.10099:FINISH
        0x0160:  4544 3a42 6972 7468 6461 7920 5265 706f  ED:Birthday.Repo
        0x0170:  7274 0a31 3030 3938 3a46 494e 4953 4845  rt.10098:FINISHE
        0x0180:  443a 4269 7274 6864 6179 2052 6570 6f72  D:Birthday.Repor
        0x0190:  740a 3130 3039 373a 4649 4e49 5348 4544  t.10097:FINISHED
        0x01a0:  3a42 6972 7468 6461 7920 5265 706f 7274  :Birthday.Report
        0x01b0:  3c2f 703e 3c2f 626f 6479 3e3c 2f68 746d  [color=blue]</p></body></htm[/color]
        0x01c0:  6c3e 0d0a 300d 0a0d 0a                  [color=blue]l>[/color]..0....
[/tt]

...and here is what is should look like:
[tt]
      0x0000:  4500 0181 7ad2 4000 7f06 1f3b 0a01 1996  E...z.@....;....
        0x0010:  0acd 3206 0050 74ae 9e6e b87e 9ac9 eade  ..2..Pt..n.~....
        0x0020:  8018 ffff d5be 0000 0101 080a 0076 336a  .............v3j
        0x0030:  053e fae0 4854 5450 2f31 2e31 2032 3030  .>..HTTP/1.1.200
        0x0040:  204f 4b0d 0a44 6174 653a 2046 7269 2c20  .OK..Date:.Fri,.
        0x0050:  3034 2041 7567 2032 3030 3620 3230 3a33  04.Aug.2006.20:3
        0x0060:  323a 3531 2047 4d54 0d0a 5365 7276 6572  2:51.GMT..Server
        0x0070:  3a20 4a65 7474 792f 342e 322e 3230 2028  :.Jetty/4.2.20.(
        0x0080:  5769 6e64 6f77 7320 3230 3033 2f35 2e32  Windows.2003/5.2
        0x0090:  2078 3836 206a 6176 612f 312e 342e 325f  .x86.java/1.4.2_
        0x00a0:  3038 290d 0a43 6f6e 7465 6e74 2d54 7970  08)..Content-Typ
        0x00b0:  653a 2074 6578 742f 6874 6d6c 0d0a 5472  e:.text/html..Tr
        0x00c0:  616e 7366 6572 2d45 6e63 6f64 696e 673a  ansfer-Encoding:
        0x00d0:  2063 6875 6e6b 6564 0d0a 0d0a 3961 0d0a  .chunked....9a..
        0x00e0:  3130 3130 313a 4649 4e49 5348 4544 3a42  10101:FINISHED:B
        0x00f0:  6972 7468 6461 7920 5265 706f 7274 0a31  irthday.Report.1
        0x0100:  3031 3030 3a46 494e 4953 4845 443a 4269  0100:FINISHED:Bi
        0x0110:  7274 6864 6179 2052 6570 6f72 740a 3130  rthday.Report.10
        0x0120:  3039 393a 4649 4e49 5348 4544 3a42 6972  099:FINISHED:Bir
        0x0130:  7468 6461 7920 5265 706f 7274 0a31 3030  thday.Report.100
        0x0140:  3938 3a46 494e 4953 4845 443a 4269 7274  98:FINISHED:Birt
        0x0150:  6864 6179 2052 6570 6f72 740a 3130 3039  hday.Report.1009
        0x0160:  373a 4649 4e49 5348 4544 3a42 6972 7468  7:FINISHED:Birth
        0x0170:  6461 7920 5265 706f 7274 0d0a 300d 0a0d  day.Report..0...
        0x0180:  0a                                      .
[/tt]

Any ideas how I can avoid this?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.