# HAProxy persistence issue

**URL:** <https://discourse.haproxy.org/t/haproxy-persistence-issue/5906>\
**Category:** Help!\
**Created:** [November 10, 2020, 11:04am UTC](https://discourse.haproxy.org/t/haproxy-persistence-issue/5906 "2020-11-10T11:04:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapnilm](https://avatars.discourse-cdn.com/v4/letter/s/ea5d25/32.png) [@swapnilm](https://discourse.haproxy.org/u/swapnilm)\
**Post date:** [November 10, 2020, 11:04am UTC](https://discourse.haproxy.org/t/haproxy-persistence-issue/5906/1 "2020-11-10T11:04:23Z")

</div>

I have to write HAProxy cofiguration for testing an app. As i am new to HAProxy and not using frequently, need some help which ACL or configuration directive should be used. Following is the logic i have to apply.

Following is the Logic to apply:  
A. frontend path  
ACL check the path and redirect to backend path\_AppName if path contains AppName

```
Here i think following can be used:
1. acl host_appName path_sub appname  
use_backend pool_appname if host_appname
2. acl url_appname path -i -m beg /appname/
   use_backend backend_pool_appname if url_appname
   Which will be good?

```

B. frontend AppName  
ACL check if cookie is set, if it exists then redirect to corresponding AppName\_x backend  
ACL Check if param is set, if it exists then redirect to corresponding AppName\_x backend  
Else go to AppName\_default backend

```
I am unaware of this part. Which ACL will be helpful?

```

C. backend AppName\_default  
load balance to 1 instance and set cookie in response  
Note: App uses serverid as cookie. Can we use “appsession” in this case?

D. backend path\_AppName  
redirect to frontend AppName

E. Backend AppName\_x  
keep session affinity

Regards,  
Swapnil.
