Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4730

Differentiate backend based on existence of sticky table entry

$
0
0

@Jean_Luc wrote:

Hello Everyone,

I am wondering if it's possible to differentiate backend_use based on existence or absence of cookie in a sticky table.

Stickiness is implicit, from what I understand.
Can it be explicit ? Is there a fetch against sticky table, that can be used in ACL ?

What I'd like to do is allow access to other_backend server, based on cookie set by auth_backend server.

Basically stuff like this:

#########
acl authorized hdr.cookie(appcookie) if my_cookies <--- this is my imagined code

use_backend redir if other_backend !authorized
use_backend other_backend if other_backend authorized
use_backend auth_backend if auth_backend


backend redir
      redirect location https://auth_backend/login

backend auth_backend
      stick-table type string size 1m expire 1d store gpc0
      stick store-response res.cook(appcookie) table my_cookies
      server auth xxx.xxx.xxx.xxxx:80 check

backend other_backend
    server other xxx.xxx.xxx.xxxx:80 check
#########

Or maybe some other approach ? I'd be very gratefull for acknowledging that's doable or not and for some suggestion.

Thank you,
Pawel

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4730

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>