# ACL based on HTTP Response Set-Cookie Header

**URL:** <https://discourse.haproxy.org/t/acl-based-on-http-response-set-cookie-header/1882>\
**Category:** Help!\
**Created:** [December 8, 2017, 2:41pm UTC](https://discourse.haproxy.org/t/acl-based-on-http-response-set-cookie-header/1882 "2017-12-08T14:41:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JGaboP](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@JGaboP](https://discourse.haproxy.org/u/JGaboP)\
**Post date:** [December 8, 2017, 2:41pm UTC](https://discourse.haproxy.org/t/acl-based-on-http-response-set-cookie-header/1882/1 "2017-12-08T14:41:31Z")

</div>

Hi guys,

I am currently trying to create an ACL based on the value of the Set-Cookie Header of an HTTP Response given by one of the backend servers. Based on this, being the response an HTTP 301 Moved Permanently, I need to change the Location to which the browser will be then redirected.

This is how it looks right now:

frontend http\_front:  
…  
…  
…  
acl is\_new\_bck hdr(Set-Cookie) -m sub value=cookie\_1  
rspirep ^Location:\ [https://www.example.com](https://www.example.com)(.\*) Location:\ [https://ww2.example.com/](https://ww2.example.com/) if is\_new\_bck

However, I am getting the following error:  
“acl ‘is\_new\_bck’ will never match because it only involves keywords that are incompatible with 'frontend http-response header rule”

Can someone help me with this? Where should I put this check? The rspirep works fine. What I need is how to configure the ACL rule.

Thanks!

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [December 8, 2017, 5:54pm UTC](https://discourse.haproxy.org/t/acl-based-on-http-response-set-cookie-header/1882/2 "2017-12-08T17:54:19Z")

</div>

I think this should be res.hdr instead of hdr, so haproxy knows that it needs to look for this header in the response.

So:  
`acl is_new_bck res.hdr(Set-Cookie) -m sub value=cookie_1`
