nginx and google analytics

bwellsnc bwellsnc at
Thu Jun 23 02:39:53 MSD 2011

I am trying to find the right sub_filter settings to make nginx place
my google analytics code on all my pages.  Here is the google code:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);

  (function() {
    var ga = document.createElement('script'); ga.type =
'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' :
'http://www') + '';
    var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);


If anyone has a suggestion, I would really appreciate it. Thanks!


More information about the nginx mailing list