Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Gents, Trying to insert a google analytics/piwik javascript bit in the footer of the stream.

For some reason, I dont think you can do this with ProxyPass/ ProxyPassReverse/ vhosts...

If someone can point me in the right direction, it would be greatly appreciated!

<VirtualHost *:80>
        ServerAdmin webmaster@domain.com
        DocumentRoot /usr/local/apache/htdocs/
        ServerName search.domain.com
        ServerAlias search.domain.com
        ErrorLog logs/search.domain.com-error_log
        #CustomLog logs/search.domain.com-access.log combined

        CustomLog "|/usr/local/apache/bin/rotatelogs /usr/local/apache/logs/search.domain.com-access_log 100M" common

        <Proxy balancer://searchdomain>
            BalancerMember http://157.150.186.79
            BalancerMember http://157.150.35.20
        </Proxy>

        ExtFilterDefine piwik-search.domain.com cmd="/bin/sed s/<\/html>/<!-- Piwik --> <script type=\"text/javascript\"> var pkBaseURL = ((\"https:\" == document.location.protocol) ? \"https://weblog.domain.com/\" : \"http://weblog.domain.com/\"); document.write(unescape(\"%3Cscript src='\" + pkBaseURL + \"piwik.js' type='text/javascript'%3E%3C/script%3E\")); </script><script type=\"text/javascript\"> try { var piwikTracker = Piwik.getTracker(pkBaseURL + \"piwik.php\", 7); piwikTracker.trackPageView(); piwikTracker.enableLinkTracking(); } catch( err ) {} </script><noscript><p><img src=\"http://weblog.domain.com/piwik.php?idsite=7\" style=\"border:0\" alt=\"\" /></p></noscript> <\/html>/ig"
        #AddOutputFilter piwik-search.domain.com htm html
        AddOutputFilter piwik-search.domain.com htm html shtml

        RewriteEngine on
        ProxyPass / balancer://searchdomain/
        ProxyPassReverse / balancer://searchdomain/

</VirtualHost>
share|improve this question

1 Answer 1

I don't have a solution, but the root cause of the answer is http compression. The server is compressing data at the http level. The proxy sees compressed data and string matching fails.

I've seen the same issue. Don't know what the best solution is, but I'm very interested in other answers.

share|improve this answer
    
!!! I bet you its the NetScalers!!! :) Will test and revert :) –  CMag Feb 27 '12 at 23:44
    
actually, no , fail.... testing directly to the server :( –  CMag Mar 1 '12 at 21:48
    
Too bad. This was the cause here when we could not use ExtFilter properly. Compression can come from the web server itself. My colleague tested by replacing all 'A's with a 'B', the result was an error message saying that the compressed stream is invalid. I have no other suggestion. –  Le Fab Mar 5 '12 at 7:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.