We have 3 backend servers balanced with haproxy with "cookie insert" option and ssl redirection.
For our help desk, we need operators can access a specific backend server to check specific server when we have problems on this backend server.
We try to do that with the following section, so no hosts file nor DNS mapping and special binding on backend servers are needed to access specific backend server, maintaining the right cookie after use_server.
We have 3 backend servers: web1, web4 and web10. We want to go on:
web1 if in the URL haproxy find " aps_ass_UNIQUE_web1_" -> ex: http://<mydomain>/app1/aps_ass_UNIQUE_web1_
web4 if in the URL haproxy find " aps_ass_UNIQUE_web4_" -> ex: http://<mydomain>/app1/aps_ass_UNIQUE_web4_
web4 if in the URL haproxy find " aps_ass_UNIQUE_web10_" -> ex: http://<mydomain>/app1/aps_ass_UNIQUE_web10_
Following configuration does not work, can you help to identify a solution ?
acl aps_ass_web1 path_reg (.*)\/aps_ass_UNIQUE_web1_(.*)
acl aps_ass_web4 path_reg (.*)\/aps_ass_UNIQUE_web4_(.*)
acl aps_ass_web10 path_reg (.*)\/aps_ass_UNIQUE_web10_(.*)
reqirep (.*)\/aps_ass_UNIQUE_web[0-9]*_(.*) \1\2
use-server web1 if aps_ass_web1
use-server web4 if aps_ass_web4
use-server web10 if aps_ass_web10
Thank you.
Roberto
-----Original Message-----
From: Cyril Bonté [mailto:cyril.bonte@free.fr]
Sent: martedì 28 luglio 2015 10.24
To: mlist
Cc: haproxy@formilux.org
Subject: Re: Regex
Hi again,
On 28/07/2015 09:42, mlist wrote:
>
> I wrote in the first mail I used 2 different regex. The (1) probably doesn't match, but the (2) ?
>
>> (2) reqirep (.*)\/demoj(.*) \1/DemoJ\2
>
> This regex match https://<hostname>, I'm Wrong ?
Good news for you, at this step, no, you are perfectly right (except
that there is an unneeded antislash before /demoj).
And I realize that you are also right about something unclear in the
documentation : headers transformations only apply when the request line
doesn't match. This is quite well documented in the code, not in the
documentation... Here comes the confusion on your side and mine.
This means that whatever you do, if your request line contains "/demoj"
a regex like (.*)/demoj(.*) will never apply to headers.
You have to sepcify 2 different regex which will ensure that will match
only one case at a time (request line OR headers).
But I still don't understand why you want to modify the referer.
--
Cyril Bonté
--
Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.
For our help desk, we need operators can access a specific backend server to check specific server when we have problems on this backend server.
We try to do that with the following section, so no hosts file nor DNS mapping and special binding on backend servers are needed to access specific backend server, maintaining the right cookie after use_server.
We have 3 backend servers: web1, web4 and web10. We want to go on:
web1 if in the URL haproxy find " aps_ass_UNIQUE_web1_" -> ex: http://<mydomain>/app1/aps_ass_UNIQUE_web1_
web4 if in the URL haproxy find " aps_ass_UNIQUE_web4_" -> ex: http://<mydomain>/app1/aps_ass_UNIQUE_web4_
web4 if in the URL haproxy find " aps_ass_UNIQUE_web10_" -> ex: http://<mydomain>/app1/aps_ass_UNIQUE_web10_
Following configuration does not work, can you help to identify a solution ?
acl aps_ass_web1 path_reg (.*)\/aps_ass_UNIQUE_web1_(.*)
acl aps_ass_web4 path_reg (.*)\/aps_ass_UNIQUE_web4_(.*)
acl aps_ass_web10 path_reg (.*)\/aps_ass_UNIQUE_web10_(.*)
reqirep (.*)\/aps_ass_UNIQUE_web[0-9]*_(.*) \1\2
use-server web1 if aps_ass_web1
use-server web4 if aps_ass_web4
use-server web10 if aps_ass_web10
Thank you.
Roberto
-----Original Message-----
From: Cyril Bonté [mailto:cyril.bonte@free.fr]
Sent: martedì 28 luglio 2015 10.24
To: mlist
Cc: haproxy@formilux.org
Subject: Re: Regex
Hi again,
On 28/07/2015 09:42, mlist wrote:
>
> I wrote in the first mail I used 2 different regex. The (1) probably doesn't match, but the (2) ?
>
>> (2) reqirep (.*)\/demoj(.*) \1/DemoJ\2
>
> This regex match https://<hostname>, I'm Wrong ?
Good news for you, at this step, no, you are perfectly right (except
that there is an unneeded antislash before /demoj).
And I realize that you are also right about something unclear in the
documentation : headers transformations only apply when the request line
doesn't match. This is quite well documented in the code, not in the
documentation... Here comes the confusion on your side and mine.
This means that whatever you do, if your request line contains "/demoj"
a regex like (.*)/demoj(.*) will never apply to headers.
You have to sepcify 2 different regex which will ensure that will match
only one case at a time (request line OR headers).
But I still don't understand why you want to modify the referer.
--
Cyril Bonté
--
Il messaggio e' stato analizzato alla ricerca di virus o
contenuti pericolosi da MailScanner, ed e'
risultato non infetto.