# Problem with Substitutions NginxHttpSubsModule

**URL:** <https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100>\
**Category:** NGINX\
**Created:** [August 11, 2010, 8:18am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100 "2010-08-11T08:18:33Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 8:18am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/1 "2010-08-11T08:18:33Z")

</div>

I m’ having problems with Substitutions NginxHttpSubsModule,  
Everything seems to be well installed, but it doesn’t substitute  
anything in the html pages.

Here is my config file:

* * *

upstream hoplanet {

```
 ip_hash;
 server 94.23.227.152:9190 max_fails=6 fail_timeout=60s;
 server 94.23.227.152:9191 max_fails=6 fail_timeout=60s;
 server 94.23.227.152:9192 max_fails=6 fail_timeout=60s;
 server 94.23.227.152:9193 max_fails=6 fail_timeout=60s;

```

}

server {  
listen 8201;  
server\_namewww.hopla-net.com [hopla-net.com](http://hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

 rewrite 

```

^/(.\*)/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/$1  
last;

```
 location / {
   subs_filter_types text/html text/xml;
   subs_filter chantent blabla;
   proxy_passhttp://hoplanet;
 }

```

}

* * *

I’ve desactivated Varnish and request directly to nginx, but ‘chantent’  
in my pages are not substitued.

I wonder if substitution doesn’t work on proxied data???

Could you help me with that?

Thank you very much

Martronic SA  
Martial Moret

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 8:41am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/2 "2010-08-11T08:41:57Z")

</div>

Martronic SA at 2010-8-11 14:17 wrote:

> ```
> server 94.23.227.152:9191 max_fails=6 fail_timeout=60s;
> if ($host ~* ^hopla-net\.com$) {
> proxy_pass http://hoplanet;
> }
> 
> ```
> 
> }
> 
> * * *
> 
> I’ve desactivated Varnish and request directly to nginx, but ‘chantent’ in my pages are not substitued.
> 
> I wonder if substitution doesn’t work on proxied data???  
> Could you show me the debug.log? And what’s your Nginx’s version?  
> Thanks.  
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 8:54am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/3 "2010-08-11T08:54:50Z")

</div>

here is a part error.log but there was nothing particluar in it:

* * *

2010/08/10 18:07:16 [notice] 5917#0: \*2003 “^hopla-net.com$” does not  
match  
“[www.hopla-net.com](http://www.hopla-net.com)”, client: 212.74.132.20, server:www.hopla-net.com,  
request: “GET  
/bale/sitemap.xml HTTP/1.1”, host: “[www.hopla-net.com:8201](http://www.hopla-net.com:8201)”  
2010/08/10 18:07:16 [notice] 5917#0: _2003 "^/(._)" matches  
“/bale/sitemap.xml”, client:  
212.74.132.20, server:www.hopla-net.com, request: “GET /bale/sitemap.xml  
HTTP/1.1”, host:  
“[www.hopla-net.com:8201](http://www.hopla-net.com:8201)”  
2010/08/10 18:07:16 [notice] 5917#0: \*2003 rewritten data:  
“/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/bale/sitemap.xml”,  
args:  
“”, client: 212.74.132.20, server:www.hopla-net.com, request: “GET  
/bale/sitemap.xml  
HTTP/1.1”, host: “[www.hopla-net.com:8201](http://www.hopla-net.com:8201)”

* * *

This also:

* * *

2010/08/10 16:55:28 [emerg] 20796#0: bind() to 0.0.0.0:8201 failed (98:  
Address already in use)  
2010/08/10 16:55:28 [emerg] 20796#0: still could not bind()  
2010/08/10 17:01:07 [error] 20907#0: \*176 open()  
“/usr/html/w00tw00t.at.ISC.SANS.DFind:)”  
failed (2: No such file or directory), client: 127.0.0.1, server:  
localhost, request: “GET  
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1”, host: “127.0.0.1”  
2010/08/10 17:05:57 [alert] 20903#0: worker process 20904 exited on  
signal 9  
2010/08/10 17:05:57 [alert] 20903#0: worker process 20907 exited on  
signal 9  
2010/08/10 17:20:38 [error] 24225#0: \*1468 open()  
“/usr/html/w00tw00t.at.ISC.SANS.DFind:)”  
failed (2: No such file or directory), client: 127.0.0.1, server:  
localhost, request: “GET  
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1”, host: “127.0.0.1”  
2010/08/10 17:21:28 [error] 24225#0: \*1577 open()  
“/usr/html/w00tw00t.at.ISC.SANS.DFind:)”  
failed (2: No such file or directory), client: 127.0.0.1, server:  
localhost, request: “GET  
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1”, host: “127.0.0.1”  
2010/08/10 17:24:20 [error] 28899#0: \*137 open()  
“/usr/html/w00tw00t.at.ISC.SANS.DFind:)”  
failed (2: No such file or directory), client: 127.0.0.1, server:  
localhost, request: “GET  
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1”, host: “127.0.0.1”  
2010/08/10 17:38:25 [error] 28898#0: \*1146 open()  
“/usr/html/w00tw00t.at.ISC.SANS.DFind:)”  
failed (2: No such file or directory), client: 127.0.0.1, server:  
localhost, request: “GET  
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1”, host: “127.0.0.1”  
2010/08/10 17:48:28 [error] 4386#0: \*142 open()  
“/usr/html/w00tw00t.at.ISC.SANS.DFind:)”  
failed (2: No such file or directory), client: 127.0.0.1, server:  
localhost, request: “GET  
/w00tw00t.at.ISC.SANS.DFind:) HTTP/1.1”, host: “127.0.0.1”

* * *

Here is the summary with our nginx version:

* * *

/usr/sbin/nginx -V  
nginx version: nginx/0.7.67  
built by gcc 4.3.2 (Debian 4.3.2-1.1)  
TLS SNI support enabled  
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf  
–http-log-path=/var/log/nginx/access\_log  
–error-log-path=/var/log/nginx/error\_log  
–pid-path=/var/run/nginx.pid  
–http-client-body-temp-path=/var/lib/nginx/body  
–http-proxy-temp-path=/var/tmp/nginx/proxy  
–http-fastcgi-temp-path=/var/tmp/nginx/fastcgi  
–with-md5-asm --with-md5=/usr/include --with-sha1-asm  
–with-sha1=/usr/include  
–with-http\_realip\_module --with-http\_ssl\_module  
–with-http\_stub\_status\_module  
–with-http\_ssl\_module --with-http\_flv\_module  
–with-http\_gzip\_static\_module  
–add-module=/root/substitutions4nginx

* * *

Thank you!

Martronic SA  
Martial Moret

Le 11.08.2010 08:41, Weibin Y. a écrit :

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 10:06am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/4 "2010-08-11T10:06:15Z")

</div>

That’s it!!! I was zipping the content in the backend!  
Thank you very much!

Another question:  
Do you think it’s possible to “optimize” the html code using your  
product and regular expressions?  
Removing unnecessary backspaces and so on?

Thank you again!

Le 11.08.2010 09:26, Weibin Y. a Ã©crit :

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 9:28am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/5 "2010-08-11T09:28:12Z")

</div>

Martronic SA at 2010-8-11 14:54 wrote:

> here is a part error.log but there was nothing particluar in it:  
> Hiï¼ŒMartronic,  
> You should activate debug log when nginx compiled with --with-debug  
> configure argument.  
> Do you compress the pages in the backends? or content-encoding else?  
> Thanks.  
> 212.74.132.20, server:www.hopla-net.com, request: "GET
> 
> * * *
> 
> localhost, request: "GET  
> 2010/08/10 17:21:28 [error] 24225#0: \*1577 open()  
> “/usr/html/w00tw00t.at.ISC.SANS.DFind:)”
> 
> –error-log-path=/var/log/nginx/error\_log  
> –add-module=/root/substitutions4nginx
> 
> > Martronic SA at 2010-8-11 14:17 wrote:
> > 
> > > ```
> > > server 94.23.227.152:9191 max_fails=6 fail_timeout=60s;
> > > if ($host ~* ^hopla-net\.com$) {
> > > subs_filter_types text/html text/xml;
> > > 
> > > ```
> > > 
> > > I wonder if substitution doesn’t work on proxied data???
> 
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 10:29am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/6 "2010-08-11T10:29:05Z")

</div>

Ok, thank you very much for your help!

Martronic SA  
Martial Moret

Le 11.08.2010 10:19, Weibin Y. a Ã©crit :

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 5:46pm UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/7 "2010-08-11T17:46:59Z")

</div>

I have a new question!

Is it possible to disable the subsitution rules (subs\_filter) under a  
particular condition (if)  
I’ve tried to set those rules in a condition :

if ($http\_cookie !~\* “\_\_ac”) {  
subs\_filter\_types text/html;  
subs\_filter tt.site.domain aa.site.domain;  
}

The error is that it’s not allowed to use this here.

Any idea or solution?

Thank you

Martronic SA  
Martial Moret

Le 11.08.2010 10:19, Weibin Y. a Ã©crit :

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 12, 2010, 3:58am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/8 "2010-08-12T03:58:45Z")

</div>

Martronic SA at 2010-8-11 23:45 wrote:

> The error is that it’s not allowed to use this here.  
> No, this module is a filter module which can’t be controlled by the ‘if’  
> directive.  
> But you can use the ‘rewrite’ directive to redirect the request to  
> another location where you can use the substitutions module.
> 
> Any idea or solution?  
> Thank you
> 
> Martronic SA  
> Martial Moret

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 11, 2010, 10:21am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/9 "2010-08-11T10:21:28Z")

</div>

Martronic SA at 2010-8-11 16:04 wrote:

> That’s it!!! I was zipping the content in the backend!  
> Thank you very much!
> 
> Another question:  
> Do you think it’s possible to “optimize” the html code using your  
> product and regular expressions?  
> Removing unnecessary backspaces and so on?  
> 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.

My module is processing the content on the fly. It will consume a lot of  
resource.

I will publish my module soon in the develop branch:  
[http://substitutions4nginx.googlecode.com/svn/branches/dev/](http://substitutions4nginx.googlecode.com/svn/branches/dev/). It’s very  
steady now. I have do some refactor and optimizing works in this branch,  
you should have try.

Thanks.

> > Thanks.
> > 
> > > 212.74.132.20, server:www.hopla-net.com, request: "GET
> > > 
> > > * * *
> > > 
> > > localhost, request: "GET  
> > > 2010/08/10 17:21:28 [error] 24225#0: \*1577 open()  
> > > “/usr/html/w00tw00t.at.ISC.SANS.DFind:)”
> > > 
> > > –error-log-path=/var/log/nginx/error\_log  
> > > –add-module=/root/substitutions4nginx
> > > 
> > > > Martronic SA at 2010-8-11 14:17 wrote:
> > > > 
> > > > > ```
> > > > > server 94.23.227.152:9191 max_fails=6 fail_timeout=60s;
> > > > > if ($host ~* ^hopla-net\.com$) {
> > > > > subs_filter_types text/html text/xml;
> > > > > 
> > > > > ```
> > > > > 
> > > > > I wonder if substitution doesn’t work on proxied data???
> > > 
> > > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > > [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 13, 2010, 5:45am UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/10 "2010-08-13T05:45:27Z")

</div>

Martronic SA at 2010-8-12 23:59 wrote:

> server {  
> rewrite (.\*)/fiter/$ [http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
> subs\_filter\_types text/html text/xml;  
> subs\_filter ‘[http://www.hopla-net.com/bale](http://www.hopla-net.com/bale)’ ‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
> proxy\_pass [http://hoplanet](http://hoplanet);  
> }  
> }

I don’t know if your configuration can work. But it is not necessary use  
the external rewrite. What about like this:

server {

if ($hhtp\_kookie !~\* “\_\_ac”) {  
rewrite ^(.\*) $1/filter/;  
}

location = / {  
proxy\_pass [http://hoplanet](http://hoplanet);  
}

location ~\* ^(.\*)/filter/$ {  
set $true\_uri $1;  
subs\_filter\_types text/html text/xml;  
subs\_filter ‘[http://www.hopla-net.com/bale](http://www.hopla-net.com/bale)’  
‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
proxy\_pass http://hoplanet$true\_uri;  
}  
}

> Le 11.08.2010 17:45, Martronic SA a Ã©crit :
> 
> > > Martronic SA at 2010-8-11 16:04 wrote:  
> > > My module is processing the content on the fly. It will consume a
> > > 
> > > > > > * * *
> > > > > > 
> > > > > > “www.hopla-net.com:8201”  
> > > > > > This also:  
> > > > > > 2010/08/10 17:05:57 [alert] 20903#0: worker process 20904 exited  
> > > > > > failed (2: No such file or directory), client: 127.0.0.1, server:  
> > > > > > localhost, request: "GET
> > > > > > 
> > > > > > –http-client-body-temp-path=/var/lib/nginx/body
> > > > > > 
> > > > > > * * *
> > > > > > 
> > > > > > > > Everything seems to be well installed, but it doesn’t  
> > > > > > > > server 94.23.227.152:9193 max\_fails=6 fail\_timeout=60s;  
> > > > > > > > break;  
> > > > > > > > proxy\_pass [http://hoplanet](http://hoplanet);  
> > > > > > > > Thanks.
> > > > > > > > 
> > > > > > > > * * *
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 12, 2010, 5:59pm UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/11 "2010-08-12T17:59:58Z")

</div>

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 ^/bale(.\*) [http://bale.hopla-net.com$1/filter/](http://bale.hopla-net.com$1/filter/);  
}

location = / {  
proxy\_passhttp://hoplanet;  
}

location/filter/$ {  
rewrite (.\*)/fiter/$[http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
subs\_filter\_types text/html text/xml;  
subs\_filter  
‘[http://www.hopla-net.com/bale](http://www.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
proxy\_passhttp://hoplanet;  
}  
}

* * *

Is that the good way to do it? or is there another way to write that  
conditional rule?

Thank you!

Martronic SA  
Martial Moret

Le 11.08.2010 17:45, Martronic SA a Ã©crit :

---

<div class="post-metadata">

**Author:** ![Martronic\_SA](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Martronic\_SA](https://www.ruby-forum.com/u/Martronic_SA)\
**Post date:** [August 17, 2010, 5:35pm UTC](https://www.ruby-forum.com/t/problem-with-substitutions-nginxhttpsubsmodule/193100/12 "2010-08-17T17:35:24Z")

</div>

_This part is working well:_

* * *

upstream hoplanet {  
ip\_hash;  
server 94.23.227.152:9190 max\_fails=6 fail\_timeout=60s;  
server 94.23.227.152:9191 max\_fails=6 fail\_timeout=60s;  
server 94.23.227.152:9192 max\_fails=6 fail\_timeout=60s;  
server 94.23.227.152:9193 max\_fails=6 fail\_timeout=60s;  
}

server {  
listen 8201;  
server\_namewww.hopla-net.com [hopla-net.com](http://hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

    rewrite ^/bale(.*)http://bale.hopla-net.com$1;
    rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
    rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
    rewrite ^/jura(.*)http://jura.hopla-net.com$1;
    rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;
    subs_filter_types text/html text/xml;
    subs_filter 

```

‘[http://www.hopla-net.com/alsace](http://www.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/bade-sud](http://www.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/bale](http://www.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/jura](http://www.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/bons-plans](http://www.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;

```
 rewrite 

```

^/(.\*)/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/$1  
last;

```
 location / {
   proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bale.hopla-net.com](http://bale.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

    rewrite ^/accueil(.*)http://www.hopla-net.com$1;
    rewrite ^/bale(.*)http://bale.hopla-net.com$1;
    rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
    rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
    rewrite ^/jura(.*)http://jura.hopla-net.com$1;
    rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;

    subs_filter_types text/html text/xml;
    subs_filter 'id="portal-logo" href="http://bale.hopla-net.com"' 

```

‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://bale.hopla-net.com](http://bale.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://bale.hopla-net.com/accueil](http://bale.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://bale.hopla-net.com/alsace](http://bale.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/bade-sud](http://bale.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/bale](http://bale.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/jura](http://bale.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/bons-plans](http://bale.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/bale.hopla-net.com:80/hopla-net/bale/VirtualHostRoot/$1  
last;

```
 location / {
   proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [alsace.hopla-net.com](http://alsace.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

 rewrite ^/accueil(.*)http://www.hopla-net.com$1;
 rewrite ^/bale(.*)http://bale.hopla-net.com$1;
 rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
 rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
 rewrite ^/jura(.*)http://jura.hopla-net.com$1;
 rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;

    subs_filter_types text/html text/xml;
    subs_filter 'id="portal-logo" 

```

href=“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://alsace.hopla-net.com/accueil](http://alsace.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/alsace](http://alsace.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/bade-sud](http://alsace.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/bale](http://alsace.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/jura](http://alsace.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/bons-plans](http://alsace.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/alsace.hopla-net.com:80/hopla-net/alsace/VirtualHostRoot/$1  
last;

```
 location / {
   proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bade-sud.hopla-net.com](http://bade-sud.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

 rewrite ^/accueil(.*)http://www.hopla-net.com$1;
 rewrite ^/bale(.*)http://bale.hopla-net.com$1;
 rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
 rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
 rewrite ^/jura(.*)http://jura.hopla-net.com$1;
 rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;

    subs_filter_types text/html text/xml;
    subs_filter 'id="portal-logo" 

```

href=“[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)”’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/accueil](http://bade-sud.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/alsace](http://bade-sud.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/bade-sud](http://bade-sud.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/bale](http://bade-sud.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/jura](http://bade-sud.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/bons-plans](http://bade-sud.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/bade-sud.hopla-net.com:80/hopla-net/bade-sud/VirtualHostRoot/$1  
last;

```
 location / {
   proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [jura.hopla-net.com](http://jura.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

 rewrite ^/accueil(.*)http://www.hopla-net.com$1;
 rewrite ^/bale(.*)http://bale.hopla-net.com$1;
 rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
 rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
 rewrite ^/jura(.*)http://jura.hopla-net.com$1;
 rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;

    subs_filter_types text/html text/xml;
    subs_filter 'id="portal-logo" href="http://jura.hopla-net.com"' 

```

‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://jura.hopla-net.com](http://jura.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://jura.hopla-net.com/accueil](http://jura.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://jura.hopla-net.com/alsace](http://jura.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/bade-sud](http://jura.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/bale](http://jura.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/jura](http://jura.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/bons-plans](http://jura.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/jura.hopla-net.com:80/hopla-net/jura/VirtualHostRoot/$1  
last;

```
 location / {
   proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bons-plans.hopla-net.com](http://bons-plans.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;  
access\_log /dev/null;

```
 if ($host ~* ^hopla-net\.com$) {
    rewrite ^(.*)http://www.hopla-net.com$1 permanent;
    break;
 }

 rewrite ^/accueil(.*)http://www.hopla-net.com$1;
 rewrite ^/bale(.*)http://bale.hopla-net.com$1;
 rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
 rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
 rewrite ^/jura(.*)http://jura.hopla-net.com$1;
 rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;

    subs_filter_types text/html text/xml;
    subs_filter 'id="portal-logo" 

```

href=“[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)”’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home”  
href=“[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)”’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/accueil](http://bons-plans.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/alsace](http://bons-plans.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/bade-sud](http://bons-plans.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/bale](http://bons-plans.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/jura](http://bons-plans.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter ‘[http://bons-plans.hopla-net.com/bons-plans](http://bons-plans.hopla-net.com/bons-plans)’  
‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/bons-plans.hopla-net.com:80/hopla-net/bons-plans/VirtualHostRoot/$1  
last;

```
 location / {
   proxy_passhttp://hoplanet;
 }

```

}

* * *

_This part is not working…_

* * *

upstream hoplanet {  
ip\_hash;  
server 94.23.227.152:9190 max\_fails=6 fail\_timeout=60s;  
server 94.23.227.152:9191 max\_fails=6 fail\_timeout=60s;  
server 94.23.227.152:9192 max\_fails=6 fail\_timeout=60s;  
server 94.23.227.152:9193 max\_fails=6 fail\_timeout=60s;  
}

server {  
listen 8201;  
server\_namewww.hopla-net.com [hopla-net.com](http://hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;

```
 if ($host ~* ^hopla-net\.com$) {
     rewrite ^(.*)http://www.hopla-net.com$1 permanent;
     break;
 }

 if ($http_kookie !~* "__ac") {
     rewrite ^/bale(.*)http://bale.hopla-net.com$1;
     rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
     rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
     rewrite ^/jura(.*)http://jura.hopla-net.com$1;
     rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;
     rewrite ^(.*) $1/filter/;
 }

 location ~* ^(.*)/filter/$ {
     set $true_uri $1;
     subs_filter_types text/html text/xml;
     subs_filter 

```

‘[http://www.hopla-net.com/alsace](http://www.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/bade-sud](http://www.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/bale](http://www.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/jura](http://www.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://www.hopla-net.com/bons-plans](http://www.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;  
proxy\_pass  
[http://hoplanet/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/$true\_uri](http://hoplanet/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/$true_uri);  
break;  
}

```
 rewrite 

```

^/(.\*)/VirtualHostBase/http/www.hopla-net.com:80/hopla-net/VirtualHostRoot/$1  
last;

```
 location / {
     proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bale.hopla-net.com](http://bale.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;

```
 if ($http_kookie !~* "__ac") {
     rewrite ^/accueil(.*)http://www.hopla-net.com$1;
     rewrite ^/alsace(.*)http://alsace.hopla-net.com$1;
     rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
     rewrite ^/jura(.*)http://jura.hopla-net.com$1;
     rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;
     rewrite ^(.*) $1/filter/;
 }

 location ~* ^(.*)/filter/$ {
     set $true_uri $1;
     subs_filter_types text/html text/xml;
     subs_filter 'id="portal-logo" href="http://bale.hopla-net.com"' 

```

‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://bale.hopla-net.com](http://bale.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://bale.hopla-net.com/accueil](http://bale.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://bale.hopla-net.com/alsace](http://bale.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/bade-sud](http://bale.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/jura](http://bale.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://bale.hopla-net.com/bons-plans](http://bale.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;  
proxy\_pass  
[http://hoplanet/VirtualHostBase/http/bale.hopla-net.com:80/hopla-net/bale/VirtualHostRoot/$true\_uri](http://hoplanet/VirtualHostBase/http/bale.hopla-net.com:80/hopla-net/bale/VirtualHostRoot/$true_uri);  
break;  
}

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/bale.hopla-net.com:80/hopla-net/bale/VirtualHostRoot/$1  
last;

```
 location / {
     proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [alsace.hopla-net.com](http://alsace.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;

```
 if ($http_kookie !~* "__ac") {
     rewrite ^/accueil(.*)http://www.hopla-net.com$1;
     rewrite ^/bale(.*)http://bale.hopla-net.com$1;
     rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
     rewrite ^/jura(.*)http://jura.hopla-net.com$1;
     rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;
     rewrite ^(.*) $1/filter/;
 }

 location ~* ^(.*)/filter/$ {
     set $true_uri $1;
     subs_filter_types text/html text/xml;
     subs_filter 'id="portal-logo" 

```

href=“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://alsace.hopla-net.com/accueil](http://alsace.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/bade-sud](http://alsace.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/bale](http://alsace.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/jura](http://alsace.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://alsace.hopla-net.com/bons-plans](http://alsace.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;  
proxy\_pass  
[http://hoplanet/VirtualHostBase/http/alsace.hopla-net.com:80/hopla-net/alsace/VirtualHostRoot/$true\_uri](http://hoplanet/VirtualHostBase/http/alsace.hopla-net.com:80/hopla-net/alsace/VirtualHostRoot/$true_uri);  
break;  
}

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/alsace.hopla-net.com:80/hopla-net/alsace/VirtualHostRoot/$1  
last;

```
 location / {
     proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bade-sud.hopla-net.com](http://bade-sud.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;

```
 if ($http_kookie !~* "__ac") {
     rewrite ^/accueil(.*)http://www.hopla-net.com$1;
     rewrite ^/bale(.*)http://bale.hopla-net.com$1;
     rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
     rewrite ^/jura(.*)http://jura.hopla-net.com$1;
     rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;
     rewrite ^(.*) $1/filter/;
 }

 location ~* ^(.*)/filter/$ {
     set $true_uri $1;
     subs_filter_types text/html text/xml;
     subs_filter 'id="portal-logo" 

```

href=“[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)”’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/accueil](http://bade-sud.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/alsace](http://bade-sud.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/bale](http://bade-sud.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/jura](http://bade-sud.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
subs\_filter  
‘[http://bade-sud.hopla-net.com/bons-plans](http://bade-sud.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;  
proxy\_pass  
[http://hoplanet/VirtualHostBase/http/bade-sud.hopla-net.com:80/hopla-net/bade-sud/VirtualHostRoot/$true\_uri](http://hoplanet/VirtualHostBase/http/bade-sud.hopla-net.com:80/hopla-net/bade-sud/VirtualHostRoot/$true_uri);  
break;  
}

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/bade-sud.hopla-net.com:80/hopla-net/bade-sud/VirtualHostRoot/$1  
last;

```
 location / {
     proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [jura.hopla-net.com](http://jura.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;

```
 if ($http_kookie !~* "__ac") {
     rewrite ^/accueil(.*)http://www.hopla-net.com$1;
     rewrite ^/bale(.*)http://bale.hopla-net.com$1;
     rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
     rewrite ^/bons-plans(.*)http://bons-plans.hopla-net.com$1;
     rewrite ^(.*) $1/filter/;
 }

 location ~* ^(.*)/filter/$ {
     set $true_uri $1;
     subs_filter_types text/html text/xml;
     subs_filter 'id="portal-logo" href="http://jura.hopla-net.com"' 

```

‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home” href=“[http://jura.hopla-net.com](http://jura.hopla-net.com)”’  
‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://jura.hopla-net.com/accueil](http://jura.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://jura.hopla-net.com/alsace](http://jura.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/bade-sud](http://jura.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/bale](http://jura.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://jura.hopla-net.com/bons-plans](http://jura.hopla-net.com/bons-plans)’‘[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)’;  
proxy\_pass  
[http://hoplanet/VirtualHostBase/http/jura.hopla-net.com:80/hopla-net/jura/VirtualHostRoot/$true\_uri](http://hoplanet/VirtualHostBase/http/jura.hopla-net.com:80/hopla-net/jura/VirtualHostRoot/$true_uri);  
break;  
}

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/jura.hopla-net.com:80/hopla-net/jura/VirtualHostRoot/$1  
last;

```
 location / {
     proxy_passhttp://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bons-plans.hopla-net.com](http://bons-plans.hopla-net.com);  
access\_log /home/awstats/hoplanet/access.log varnish;

```
 if ($http_kookie !~* "__ac") {
     rewrite ^/accueil(.*)http://www.hopla-net.com$1;
     rewrite ^/bale(.*)http://bale.hopla-net.com$1;
     rewrite ^/bade-sud(.*)http://bade-sud.hopla-net.com$1;
     rewrite ^/jura(.*)http://jura.hopla-net.com$1;
     rewrite ^(.*) $1/filter/;
 }

 location ~* ^(.*)/filter/$ {
     set $true_uri $1;
     subs_filter_types text/html text/xml;
     subs_filter 'id="portal-logo" 

```

href=“[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)”’  
‘id=“portal-logo” href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter ‘class=“home”  
href=“[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)”’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)”’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/accueil](http://bons-plans.hopla-net.com/accueil)’‘[http://www.hopla-net.com/accueil](http://www.hopla-net.com/accueil)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/alsace](http://bons-plans.hopla-net.com/alsace)’‘[http://alsace.hopla-net.com](http://alsace.hopla-net.com)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/bade-sud](http://bons-plans.hopla-net.com/bade-sud)’‘[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/bale](http://bons-plans.hopla-net.com/bale)’‘[http://bale.hopla-net.com](http://bale.hopla-net.com)’;  
subs\_filter  
‘[http://bons-plans.hopla-net.com/jura](http://bons-plans.hopla-net.com/jura)’‘[http://jura.hopla-net.com](http://jura.hopla-net.com)’;  
proxy\_pass  
[http://hoplanet/VirtualHostBase/http/bons-plans.hopla-net.com:80/hopla-net/bons-plans/VirtualHostRoot/$true\_uri](http://hoplanet/VirtualHostBase/http/bons-plans.hopla-net.com:80/hopla-net/bons-plans/VirtualHostRoot/$true_uri);  
break;  
}

```
 rewrite ^/(.*)

```

/VirtualHostBase/http/bons-plans.hopla-net.com:80/hopla-net/bons-plans/VirtualHostRoot/$1  
last;

```
 location / {
     proxy_passhttp://hoplanet;
 }

```

}

* * *

Could help me with that? is there a better way to write this?  
Thank you!

Martronic SA  
Martial Moret
