Welcome! Log In Create A New Profile

Advanced

Re: Setting variable and using HttpSubModule

Maxim Dounin
June 25, 2011 06:14PM
Hello!

On Sat, Jun 25, 2011 at 05:06:23PM -0400, Jim Ohlstein wrote:

[...]

> >> Using the following:
> >>
> >> server {
> >> ...
> >>
> >> sub_filter </head>
> >> '</head><script language="javascript" src=/home/jim/ga.js></script>';
> >> sub_filter_once on;
> >>
> >> ...
> >> }
> >>
> >> resulted in the following:
> >>
> >> jim$ curl http://mysite.com/somepage
> >>
> >> ...
> >> </head><script language="javascript" src=/home/jim/ga.js></script>
> >> ...
> >>
> >> Putting the path in quotes changed nothing other than that portion being
> >> in quotes.
> >
> > There result is exactly as configured, it's not clear what you expect here.
>
> That's what I found out. :p I did some digging before I asked for help
> here and I found
> http://www.lowendtalk.com/questions/7846/automatically-reference-ga-codes-from-external-file-using-nginx-substitution-module
> which had that configuration and was obviously *wrong*. However that is
> where I got the idea to at try it.

It's not "wrong", it just references GA code in an external
javascript file which will be loaded by browser as a separate
resource. There is some downsides of this aproach (browser will
have to load another javascript resource), but it's not wrong.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Setting variable and using HttpSubModule

Jim Ohlstein June 25, 2011 12:40PM

Re: Setting variable and using HttpSubModule

Maxim Dounin June 25, 2011 04:00PM

Re: Setting variable and using HttpSubModule

Jim Ohlstein June 25, 2011 05:08PM

Re: Setting variable and using HttpSubModule

Maxim Dounin June 25, 2011 06:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 216
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready