# Error Worker process with substitutions4nginx

**URL:** <https://www.ruby-forum.com/t/error-worker-process-with-substitutions4nginx/194329>\
**Category:** NGINX\
**Created:** [September 2, 2010, 2:22pm UTC](https://www.ruby-forum.com/t/error-worker-process-with-substitutions4nginx/194329 "2010-09-02T14:22:05Z")\
**Posts on this page:** 1\
**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:** [September 2, 2010, 2:22pm UTC](https://www.ruby-forum.com/t/error-worker-process-with-substitutions4nginx/194329/1 "2010-09-02T14:22:05Z")

</div>

Hello!

I need you help…

I’m using nginx for two years without having any problems.

I want to create sub-domains on a website and I have to rewrite the urls  
with the “substitutions4nginx” module.  
Since the installation of this module and it’s configuration I’m having  
problems.

The problem is:

After some time, one or many worker process are at 100% even if there is  
not more connections on the website as there is usually.  
I have to restart nginx to have it working properly.

I think that my configuaration is not correct… In my configuration I  
would like define that there is no url rewriting when there is a cookie.

# 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 --user=www-data --group=www-data  
–conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error\_log  
–pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock  
–http-log-path=/var/log/nginx/access\_log  
–http-client-body-temp-path=/var/lib/nginx/body  
–http-proxy-temp-path=/var/lib/nginx/proxy  
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi  
–with-http\_dav\_module --with-http\_realip\_module --with-http\_ssl\_module  
–with-http\_stub\_status\_module --with-debug  
–add-module=/root/substitutions4nginx

# error.log

2010/09/02 11:46:35 [debug] 16331#0: \*1 event timer del: 14:  
1283420858304 2010/09/02 11:46:35  
[debug] 16331#0: \*1 generic phase: 0  
2010/09/02 11:46:35 [debug] 16331#0: \*1 add cleanup: 00000000006D4648  
2010/09/02 11:46:35  
[debug] 16331#0: \*1 generic phase: 1  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script var  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script var:  
“[www.hopla-net.com](http://www.hopla-net.com)” 2010/09/02  
11:46:35 [debug] 16331#0: \*1 http script regex: “^hopla-net.com$”  
2010/09/02 11:46:35  
[notice] 16331#0: \*1 “^hopla-net.com$” does not match  
“[www.hopla-net.com](http://www.hopla-net.com)”, client: 127.0.0.1,  
server: [www.hopla-net.com](http://www.hopla-net.com), reque$ 2010/09/02 11:46:35 [debug] 16331#0:  
\*1 http script if  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script if: false  
2010/09/02 11:46:35 [debug] 16331#0: _1 http script regex: "^/bale(._)"  
2010/09/02 11:46:35  
[notice] 16331#0: _1 "^/bale(._)" does not match  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/”,  
client: 127$ 2010/09/02  
11:46:35 [debug] 16331#0: _1 http script regex: "^/alsace(._)"  
2010/09/02 11:46:35 [notice]  
16331#0: _1 "^/alsace(._)" matches  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/”,  
client: 127.0.0.$  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script copy:  
“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script capture:  
“/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/”  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script regex end  
2010/09/02 11:46:35 [notice] 16331#0: \*1 rewritten redirect:  
“[http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/](http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/)”,$  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http finalize request: 302,  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/?” 1  
2010/09/02 11:46:35  
[debug] 16331#0: \*1 http special response: 302,  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/?”  
2010/09/02 11:46:35 [debug]  
16331#0: \*1 http set discard body  
2010/09/02 11:46:35 [debug] 16331#0: \*1 HTTP/1.1 302 Moved Temporarily  
Server: nginx/0.7.67  
Date: Thu, 02 Sep 2010 09:46:35 GMT  
Content-Type: text/html  
Content-Length: 161  
Connection: close  
Location:  
[http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/](http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/)  
2010/09/02 11:46:35 [debug] 16331#0: \*1 event timer del: 14:  
1283420858304 2010/09/02 11:46:35  
[debug] 16331#0: \*1 generic phase: 0  
2010/09/02 11:46:35 [debug] 16331#0: \*1 add cleanup: 00000000006D4648  
2010/09/02 11:46:35  
[debug] 16331#0: \*1 generic phase: 1  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script var  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script var:  
“[www.hopla-net.com](http://www.hopla-net.com)” 2010/09/02  
11:46:35 [debug] 16331#0: \*1 http script regex: “^hopla-net.com$”  
2010/09/02 11:46:35  
[notice] 16331#0: \*1 “^hopla-net.com$” does not match  
“[www.hopla-net.com](http://www.hopla-net.com)”, client: 127.0.0.1,  
server: [www.hopla-net.com](http://www.hopla-net.com), reque$ 2010/09/02 11:46:35 [debug] 16331#0:  
\*1 http script if  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script if: false  
2010/09/02 11:46:35 [debug] 16331#0: _1 http script regex: "^/bale(._)"  
2010/09/02 11:46:35  
[notice] 16331#0: _1 "^/bale(._)" does not match  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/”,  
client: 127$ 2010/09/02  
11:46:35 [debug] 16331#0: _1 http script regex: "^/alsace(._)"  
2010/09/02 11:46:35 [notice]  
16331#0: _1 "^/alsace(._)" matches  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/”,  
client: 127.0.0.$  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script copy:  
“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script capture:  
“/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/”  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http script regex end  
2010/09/02 11:46:35 [notice] 16331#0: \*1 rewritten redirect:  
“[http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/](http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/)”,$  
2010/09/02 11:46:35 [debug] 16331#0: \*1 http finalize request: 302,  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/?” 1  
2010/09/02 11:46:35  
[debug] 16331#0: \*1 http special response: 302,  
“/alsace/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/?”  
2010/09/02 11:46:35 [debug]  
16331#0: \*1 http set discard body  
2010/09/02 11:46:35 [debug] 16331#0: \*1 HTTP/1.1 302 Moved Temporarily  
Server: nginx/0.7.67  
Date: Thu, 02 Sep 2010 09:46:35 GMT  
Content-Type: text/html  
Content-Length: 161  
Connection: close  
Location:  
[http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/](http://alsace.hopla-net.com/artistes/peintres/lucienne-aman-aquarelle-ou-acrylique/)

graph nginx  
info-nginx

# First configuration I had (no problems):

upstream hoplanet {  
ip\_hash;  
server 127.0.0.1:8194 max\_fails=3 fail\_timeout=30s;  
server 127.0.0.1:8193 max\_fails=3 fail\_timeout=30s;  
server 127.0.0.1:8192 max\_fails=3 fail\_timeout=30s;  
server 127.0.0.1:8191 max\_fails=3 fail\_timeout=30s;  
}

server {  
listen 8201;  
server\_name [hopla-net.com](http://hopla-net.com) [www.hopla-net.com](http://www.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;
 }

 rewrite ^/(.*) 

```

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

```
 location / {
   proxy_pass http://hoplanet;
 }

```

}

# New configuration that has the problem:

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

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

```
 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_pass http://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [bale.hopla-net.com](http://bale.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;
 }

    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_pass http://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [alsace.hopla-net.com](http://alsace.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;
 }

 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_pass http://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 ($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_pass http://hoplanet;
 }

```

}

server {  
listen 8201;  
server\_name [jura.hopla-net.com](http://jura.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;
 }

 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_pass http://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 ($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_pass http://hoplanet;
 }

```

}

# This is a trial configuration so that urls are not rewritten when there is a cookie. This configuration 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](http://www.hopla-net.com$1) permanent;  
break;  
}

if ($http\_kookie !~\* “\_\_ac”) {  
rewrite ^/bale(._)[http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
rewrite ^/alsace(._)[http://alsace.hopla-net.com$1](http://alsace.hopla-net.com$1);  
rewrite ^/bade-sud(._)[http://bade-sud.hopla-net.com$1](http://bade-sud.hopla-net.com$1);  
rewrite ^/jura(._)[http://jura.hopla-net.com$1](http://jura.hopla-net.com$1);  
rewrite ^/bons-plans(._)[http://bons-plans.hopla-net.com$1](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](http://www.hopla-net.com$1);  
rewrite ^/alsace(._)[http://alsace.hopla-net.com$1](http://alsace.hopla-net.com$1);  
rewrite ^/bade-sud(._)[http://bade-sud.hopla-net.com$1](http://bade-sud.hopla-net.com$1);  
rewrite ^/jura(._)[http://jura.hopla-net.com$1](http://jura.hopla-net.com$1);  
rewrite ^/bons-plans(._)[http://bons-plans.hopla-net.com$1](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](http://bale.hopla-net.com)”  
[http://bale.hopla-net.com"](http://bale.hopla-net.com%22);’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
subs\_filter ‘class=“home” href=“[http://bale.hopla-net.com](http://bale.hopla-net.com)”  
[http://bale.hopla-net.com"](http://bale.hopla-net.com%22);’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
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](http://www.hopla-net.com$1);  
rewrite ^/bale(._)[http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
rewrite ^/bade-sud(._)[http://bade-sud.hopla-net.com$1](http://bade-sud.hopla-net.com$1);  
rewrite ^/jura(._)[http://jura.hopla-net.com$1](http://jura.hopla-net.com$1);  
rewrite ^/bons-plans(._)[http://bons-plans.hopla-net.com$1](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)”  
[http://alsace.hopla-net.com"](http://alsace.hopla-net.com%22);’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
subs\_filter ‘class=“home” href=“[http://alsace.hopla-net.com](http://alsace.hopla-net.com)”  
[http://alsace.hopla-net.com"](http://alsace.hopla-net.com%22);’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
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](http://www.hopla-net.com$1);  
rewrite ^/bale(._)[http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
rewrite ^/bade-sud(._)[http://bade-sud.hopla-net.com$1](http://bade-sud.hopla-net.com$1);  
rewrite ^/jura(._)[http://jura.hopla-net.com$1](http://jura.hopla-net.com$1);  
rewrite ^/bons-plans(._)[http://bons-plans.hopla-net.com$1](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)”  
[http://bade-sud.hopla-net.com"](http://bade-sud.hopla-net.com%22);’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
subs\_filter ‘class=“home” href=“[http://bade-sud.hopla-net.com](http://bade-sud.hopla-net.com)”  
[http://bade-sud.hopla-net.com"](http://bade-sud.hopla-net.com%22);’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
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](http://www.hopla-net.com$1);  
rewrite ^/bale(._)[http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
rewrite ^/bade-sud(._)[http://bade-sud.hopla-net.com$1](http://bade-sud.hopla-net.com$1);  
rewrite ^/bons-plans(._)[http://bons-plans.hopla-net.com$1](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](http://jura.hopla-net.com)”  
[http://jura.hopla-net.com"](http://jura.hopla-net.com%22);’ ‘id=“portal-logo”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
subs\_filter ‘class=“home” href=“[http://jura.hopla-net.com](http://jura.hopla-net.com)”  
[http://jura.hopla-net.com"](http://jura.hopla-net.com%22);’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
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](http://www.hopla-net.com$1);  
rewrite ^/bale(._)[http://bale.hopla-net.com$1](http://bale.hopla-net.com$1);  
rewrite ^/bade-sud(._)[http://bade-sud.hopla-net.com$1](http://bade-sud.hopla-net.com$1);  
rewrite ^/jura(._)[http://jura.hopla-net.com$1](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)”  
[http://bons-plans.hopla-net.com"](http://bons-plans.hopla-net.com%22);’  
‘id=“portal-logo” href=“[http://www.hopla-net.com](http://www.hopla-net.com)”  
[http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
subs\_filter ‘class=“home” href=“[http://bons-plans.hopla-net.com](http://bons-plans.hopla-net.com)”  
[http://bons-plans.hopla-net.com"](http://bons-plans.hopla-net.com%22);’ ‘class=“home”  
href=“[http://www.hopla-net.com](http://www.hopla-net.com)” [http://www.hopla-net.com"](http://www.hopla-net.com%22);’;  
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 you help me with that, please?

Thank you!

Martronic SA  
Martial Moret
