<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre wrap="">I'm still on the condition rule,
My code:

****************************************

upstream hoplanet {
        server xxx.xxx.xxx.xxx:8080;
        server xxx.xxx.xxx.xxx:8081;
}

server {

        if ($hhtp_kookie !~* "__ac") {
                rewrite ^<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>bale(.*) <a class="moz-txt-link-freetext" href="http://bale.hopla-net.com$1/filter">http://bale.hopla-net.com$1/filter</a><span
 class="moz-txt-tag">/</span></i>;
        }

        location = / {
                proxy_pass <a class="moz-txt-link-freetext" href="http://hoplanet">http://hoplanet</a>;
        }

        location <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>filter<span
 class="moz-txt-tag">/</span></i>$ {
                rewrite (.*)<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>fiter<span
 class="moz-txt-tag">/</span></i>$ <a class="moz-txt-link-freetext"
 href="http://bale.hopla-net.com$1">http://bale.hopla-net.com$1</a>;
                subs_filter_types text/html text/xml;
                subs_filter '<a class="moz-txt-link-freetext"
 href="http://www.hopla-net.com/bale">http://www.hopla-net.com/bale</a>' '<a
 class="moz-txt-link-freetext" href="http://bale.hopla-net.com">http://bale.hopla-net.com</a>';
                proxy_pass <a class="moz-txt-link-freetext" href="http://hoplanet">http://hoplanet</a>;
        }
}
</pre>
****************************************<br>
<br>
Is that the good way to do it? or is there another way to write that
conditional rule?<br>
<br>
Thank you!<br>
<br>
Martronic SA<br>
Martial Moret<br>
<br>
Le 11.08.2010 17:45, Martronic SA a écrit :
<blockquote cite="mid:4C62C59B.6060500@martronic.ch" type="cite">I have
a new question!
  <br>
  <br>
Is it possible to disable the subsitution rules (subs_filter) under a
particular condition (if)
  <br>
I've tried to set those rules in a condition :
  <br>
  <br>
 if ($http_cookie !~* "__ac") {
  <br>
    subs_filter_types text/html;
  <br>
    subs_filter tt.site.domain aa.site.domain;
  <br>
}
  <br>
  <br>
The error is that it's not allowed to use this here.
  <br>
  <br>
Any idea or solution?
  <br>
  <br>
Thank you
  <br>
  <br>
Martronic SA
  <br>
Martial Moret
  <br>
  <br>
Le 11.08.2010 10:19, Weibin Yao a écrit :
  <br>
  <blockquote type="cite">Martronic SA at 2010-8-11 16:04 wrote:
    <br>
    <blockquote type="cite">That's it!!! I was zipping the content in
the backend!
      <br>
Thank you very much!
      <br>
      <br>
Another question:
      <br>
Do you think it's possible to "optimize" the html code using your
product and regular expressions?
      <br>
Removing unnecessary backspaces and so on?
      <br>
    </blockquote>
No, it's the job you should do when you publish your pages. Maybe you
can set the gzip_filter module on. That's fine.
    <br>
    <br>
My module is processing the content on the fly. It will consume a lot
of resource.
    <br>
    <br>
I will publish my module soon in the develop branch:
<a class="moz-txt-link-freetext" href="http://substitutions4nginx.googlecode.com/svn/branches/dev/">http://substitutions4nginx.googlecode.com/svn/branches/dev/</a>. It's very
steady now. I have do some refactor and optimizing works in this
branch, you should have try.
    <br>
    <br>
Thanks.
    <br>
    <blockquote type="cite"><br>
Thank you again!
      <br>
      <br>
Le 11.08.2010 09:26, Weibin Yao a écrit :
      <br>
      <blockquote type="cite">Martronic SA at 2010-8-11 14:54 wrote:
        <br>
        <blockquote type="cite">here is a part error.log but there was
nothing particluar in it:
          <br>
        </blockquote>
Hi,Martronic,
        <br>
  You should activate debug log when nginx compiled with --with-debug
configure argument.
        <br>
  Do you compress the pages in the backends? or content-encoding else?
        <br>
  Thanks.
        <br>
        <blockquote type="cite"><br>
*********************************************
          <br>
          <br>
2010/08/10 18:07:16 [notice] 5917#0: *2003 "^hopla-net\.com$" does not
match
          <br>
"<a class="moz-txt-link-abbreviated" href="http://www.hopla-net.com">www.hopla-net.com</a>", client: 212.74.132.20, server:www.hopla-net.com,
request: "GET
          <br>
/bale/sitemap.xml HTTP/1.1", host: "<a class="moz-txt-link-abbreviated" href="http://www.hopla-net.com:8201">www.hopla-net.com:8201</a>"
          <br>
2010/08/10 18:07:16 [notice] 5917#0: *2003 "^/(.*)" matches
"/bale/sitemap.xml", client:
          <br>
212.74.132.20, server:www.hopla-net.com, request: "GET
/bale/sitemap.xml HTTP/1.1", host:
          <br>
"<a class="moz-txt-link-abbreviated" href="http://www.hopla-net.com:8201">www.hopla-net.com:8201</a>"
          <br>
2010/08/10 18:07:16 [notice] 5917#0: *2003 rewritten data:
          <br>
"/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/bale/sitemap.xml",
args:
          <br>
"", client: 212.74.132.20, server:www.hopla-net.com, request: "GET
/bale/sitemap.xml
          <br>
HTTP/1.1", host: "<a class="moz-txt-link-abbreviated" href="http://www.hopla-net.com:8201">www.hopla-net.com:8201</a>"
          <br>
          <br>
          <br>
************************************************
          <br>
          <br>
This also:
          <br>
************************************************
          <br>
          <br>
2010/08/10 16:55:28 [emerg] 20796#0: bind() to 0.0.0.0:8201 failed (98:
Address already in use)
          <br>
2010/08/10 16:55:28 [emerg] 20796#0: still could not bind()
          <br>
2010/08/10 17:01:07 [error] 20907#0: *176 open()
"/usr/html/w00tw00t.at.ISC.SANS.DFind:)"
          <br>
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "GET
          <br>
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1", host: "127.0.0.1"
          <br>
2010/08/10 17:05:57 [alert] 20903#0: worker process 20904 exited on
signal 9
          <br>
2010/08/10 17:05:57 [alert] 20903#0: worker process 20907 exited on
signal 9
          <br>
2010/08/10 17:20:38 [error] 24225#0: *1468 open()
"/usr/html/w00tw00t.at.ISC.SANS.DFind:)"
          <br>
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "GET
          <br>
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1", host: "127.0.0.1"
          <br>
2010/08/10 17:21:28 [error] 24225#0: *1577 open()
"/usr/html/w00tw00t.at.ISC.SANS.DFind:)"
          <br>
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "GET
          <br>
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1", host: "127.0.0.1"
          <br>
2010/08/10 17:24:20 [error] 28899#0: *137 open()
"/usr/html/w00tw00t.at.ISC.SANS.DFind:)"
          <br>
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "GET
          <br>
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1", host: "127.0.0.1"
          <br>
2010/08/10 17:38:25 [error] 28898#0: *1146 open()
"/usr/html/w00tw00t.at.ISC.SANS.DFind:)"
          <br>
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "GET
          <br>
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1", host: "127.0.0.1"
          <br>
2010/08/10 17:48:28 [error] 4386#0: *142 open()
"/usr/html/w00tw00t.at.ISC.SANS.DFind:)"
          <br>
failed (2: No such file or directory), client: 127.0.0.1, server:
localhost, request: "GET
          <br>
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1", host: "127.0.0.1"
          <br>
***********************************************************
          <br>
          <br>
          <br>
Here is the summary with our nginx version:
          <br>
          <br>
*************************************************
          <br>
          <br>
/usr/sbin/nginx -V
          <br>
nginx version: nginx/0.7.67
          <br>
built by gcc 4.3.2 (Debian 4.3.2-1.1)
          <br>
TLS SNI support enabled
          <br>
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf
          <br>
--http-log-path=/var/log/nginx/access_log
--error-log-path=/var/log/nginx/error_log
          <br>
--pid-path=/var/run/nginx.pid
--http-client-body-temp-path=/var/lib/nginx/body
          <br>
--http-proxy-temp-path=/var/tmp/nginx/proxy
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi
          <br>
--with-md5-asm --with-md5=/usr/include --with-sha1-asm
--with-sha1=/usr/include
          <br>
--with-http_realip_module --with-http_ssl_module
--with-http_stub_status_module
          <br>
--with-http_ssl_module --with-http_flv_module
--with-http_gzip_static_module
          <br>
--add-module=/root/substitutions4nginx
          <br>
          <br>
*************************************************
          <br>
          <br>
Thank you!
          <br>
          <br>
Martronic SA
          <br>
Martial Moret
          <br>
          <br>
          <br>
Le 11.08.2010 08:41, Weibin Yao a écrit :
          <br>
          <blockquote type="cite">Martronic SA at 2010-8-11 14:17
wrote:
            <br>
            <blockquote type="cite">I m' having problems with
Substitutions NginxHttpSubsModule,
              <br>
Everything seems to be well installed, but it doesn't substitute
anything in the html pages.
              <br>
              <br>
Here is my config file:
              <br>
              <br>
********************************************
              <br>
 upstream hoplanet {
              <br>
    ip_hash;
              <br>
    server 94.23.227.152:9190 max_fails=6 fail_timeout=60s;
              <br>
    server 94.23.227.152:9191 max_fails=6 fail_timeout=60s;
              <br>
    server 94.23.227.152:9192 max_fails=6 fail_timeout=60s;
              <br>
    server 94.23.227.152:9193 max_fails=6 fail_timeout=60s;
              <br>
  }
              <br>
              <br>
  server {
              <br>
    listen 8201;
              <br>
    server_name <a class="moz-txt-link-abbreviated" href="http://www.hopla-net.com">www.hopla-net.com</a> hopla-net.com;
              <br>
    access_log /home/awstats/hoplanet/access.log varnish;
              <br>
    access_log /dev/null;
              <br>
              <br>
    if ($host ~* ^hopla-net\.com$) {
              <br>
       rewrite ^(.*) <a class="moz-txt-link-freetext" href="http://www.hopla-net.com$1">http://www.hopla-net.com$1</a> permanent;
              <br>
       break;
              <br>
    }
              <br>
              <br>
              <br>
    rewrite ^/(.*)
/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/$1
last;
              <br>
              <br>
    location / {
              <br>
      subs_filter_types text/html text/xml;
              <br>
      subs_filter chantent blabla;
              <br>
      proxy_pass <a class="moz-txt-link-freetext" href="http://hoplanet">http://hoplanet</a>;
              <br>
    }
              <br>
              <br>
  }
              <br>
****************************************************
              <br>
              <br>
I've desactivated Varnish and request directly to nginx, but 'chantent'
in my pages are not substitued.
              <br>
              <br>
I wonder if substitution doesn't work on proxied data???
              <br>
            </blockquote>
Could you show me the debug.log? And what's your Nginx's version?
            <br>
Thanks.
            <br>
            <blockquote type="cite"><br>
Could you help me with that?
              <br>
              <br>
Thank you very much
              <br>
              <br>
Martronic SA
              <br>
Martial Moret
              <br>
------------------------------------------------------------------------
              <br>
              <br>
_______________________________________________
              <br>
nginx mailing list
              <br>
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
              <br>
<a class="moz-txt-link-freetext" href="http://nginx.org/mailman/listinfo/nginx">http://nginx.org/mailman/listinfo/nginx</a>
              <br>
            </blockquote>
            <br>
            <br>
          </blockquote>
          <br>
_______________________________________________
          <br>
nginx mailing list
          <br>
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
          <br>
<a class="moz-txt-link-freetext" href="http://nginx.org/mailman/listinfo/nginx">http://nginx.org/mailman/listinfo/nginx</a>
          <br>
          <br>
        </blockquote>
        <br>
        <br>
      </blockquote>
      <br>
_______________________________________________
      <br>
nginx mailing list
      <br>
<a class="moz-txt-link-abbreviated" href="mailto:nginx@nginx.org">nginx@nginx.org</a>
      <br>
<a class="moz-txt-link-freetext" href="http://nginx.org/mailman/listinfo/nginx">http://nginx.org/mailman/listinfo/nginx</a>
      <br>
    </blockquote>
    <br>
    <br>
  </blockquote>
</blockquote>
</body>
</html>