Quantcast
Channel: Serverphorums.com - HAProxy
Viewing all articles
Browse latest Browse all 5112

Rewrite cookie path & cookie domain (1 reply)

$
0
0
Hi all,
I've problem to rewrite cookie path and cookie domain in HAproxy; I've a
Nginx configuration but I want to move from Nginx to HAProxy for this proxy
pass.

This is a Nginx config I want to replace:

location /~xxx/ {
proxy_cookie_domain ~.* .$site.it;
proxy_cookie_path ~.* /~xxx/;
proxy_set_header Host $site.it;
proxy_pass http://192.168.1.2/;
}

I need same function of proxy_cookie_domain and proxy_cookie_path; I found
this:
http://blog.haproxy.com/2014/04/28/howto-write-apache-proxypass-rules-in-haproxy/
but not work form me.

Now I can change cookie path with:
rspirep ^(Set-Cookie:.*)\ path=(.*) \1\ path=/~xxx/

I need add also domain, only if exists, but with dynamic hostname; I;ve
tried with

acl hdr_set_cookie_domain_and_path res.hdr(Set-cookie) -m sub domain=
res.hdr(Set-cookie) -m sub path=
rspirep ^(Set-Cookie:.*)\ path=(.*) \1\ path=/~xxx/;\ domain=%[hdr(Host)]
if hdr_set_cookie_domain_and_path

But not work.


Anyone can help me?

Tnx,
rr

Viewing all articles
Browse latest Browse all 5112

Trending Articles