You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Thibaut Lemaire <ti...@gmail.com> on 2012/12/18 17:48:22 UTC

[users@httpd] DEFLATE after Substitute on Apache Proxy Server

Hi all,


I've got a problem in configuring Proxy on Apache :
I want to :
1/ get a content from a website (Deflate or not) ;
2/ apply a filter on it to substitute some text on the body of the page ;
3/ resend the page to the client after apply the Deflate filter to the 
altered page.

My configuration is like this :

ExtFilterDefine FAnalyse mode=output intype=text/html 
cmd="path_to_my_script"

<VirtualHost *:80>
ServerName site1.com
<Location />
SetOutputFilter INFLATE;FAnalyse;DEFLATE
ProxyPass http://site2.com/
Header append Vary User-Agent env=!dont-vary
</Location>
</VirtualHost>

It works fine without the DEFLATE filter but the content is not compressed.
With the DEFLATE filter, the client seems to get the compressed content 
but with bad headers because displays a page like this :

‹í39 Èæ*ô2ÃA(„ºÒªíïÄÃ5¹Q°sç¿^Þ^N.ç7Æðj#?
æÈ>ñ<ÙæýåÕßÑÍù{°D?]ßÎ~ ty&,锓qÏ:<¬Ð™àYR
lŒŒÓ@À˾íQÿqâõ¬ |ë6%^ç($aÅ ‚˜¸¬„ŠGàûqEyð

My script is not the problem because I substitute it by a Substitute 
Filter from Apache and the problem is the same.

I tried this directive :

Header append Vary User-Agent env=!dont-vary

without success.

Any idea or advice ?

Thanks by advance :)


Thibaut

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DEFLATE after Substitute on Apache Proxy Server

Posted by Thibaut Lemaire <ti...@gmail.com>.
Le 19/12/2012 16:31, Nick Kew a écrit :
> On Wed, 19 Dec 2012 10:16:06 +0100
> Thibaut Lemaire <ti...@gmail.com> wrote:
>
>> You can see the problem on this url :
>> http://test2.titag.com/
> Yep, you have a problem.  It's lacking a Content-Encoding header.
>
> Two points here:
>
> 1. It smells of bug somewhere: mod_deflate should set the header
> when you use the DEFLATE filter.  Possibly something is getting in
> after it?
Is there other possibilities in order to apply the DEFLATE filter ? Or 
to check the headers before resend and modify them as required ?
>
> 2. Using the DEFLATE filter may be a waste of time.  AIUI most of
> the 'net infrastructure builds in hardware-based compression for free.
But Google like compressed content :/
> Bug me if I don't get round to reviewing mod_deflate for
> possible bug.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DEFLATE after Substitute on Apache Proxy Server

Posted by Nick Kew <ni...@webthing.com>.
On Wed, 19 Dec 2012 10:16:06 +0100
Thibaut Lemaire <ti...@gmail.com> wrote:

> You can see the problem on this url :
> http://test2.titag.com/

Yep, you have a problem.  It's lacking a Content-Encoding header.

Two points here:

1. It smells of bug somewhere: mod_deflate should set the header
when you use the DEFLATE filter.  Possibly something is getting in
after it?

2. Using the DEFLATE filter may be a waste of time.  AIUI most of
the 'net infrastructure builds in hardware-based compression for free.

Bug me if I don't get round to reviewing mod_deflate for
possible bug.

-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DEFLATE after Substitute on Apache Proxy Server

Posted by Thibaut Lemaire <ti...@gmail.com>.
Le 18/12/2012 20:30, Nick Kew a écrit
> Something in your setup is failing to set the right headers
> to describe the contents returned.
>
> Apart from looking for clues in the error log, you could
> diagnose it starting by looking at exactly what gets
> sent to the browser.  Or you could post a URL that
> illustrates the problem, so we could check it out.
>

You can see the problem on this url :
http://test2.titag.com/

Actual configuration is :

ExtFilterDefine FAnalyse mode=output intype=text/html 
cmd="/home/dev/analyse"

<VirtualHost *:80>
         ServerName test2.titag.com
         <Location />
                 ProxyPass http://www.titag.com/
                 SetOutputFilter INFLATE;FAnalyse;DEFLATE
                 #Header append Vary User-Agent env=!dont-vary
         </Location>
</VirtualHost>


Response Headers are :

Connection 	|Keep-Alive|
Content-Type 	|text/html|
Date 	|Wed, 19 Dec 2012 09:15:08 GMT|
Keep-Alive 	|timeout=15, max=100|
Last-Modified 	|Wed, 31 Oct 2012 10:25:08 GMT|
Server 	|nginx/1.2.5|
Transfer-Encoding 	|chunked|
Vary 	|User-Agent|



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] DEFLATE after Substitute on Apache Proxy Server

Posted by Nick Kew <ni...@webthing.com>.
On 18 Dec 2012, at 16:48, Thibaut Lemaire wrote:

> I've got a problem in configuring Proxy on Apache :

Something in your setup is failing to set the right headers
to describe the contents returned.

Apart from looking for clues in the error log, you could
diagnose it starting by looking at exactly what gets
sent to the browser.  Or you could post a URL that
illustrates the problem, so we could check it out.

-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org