Haproxy behind Cloudflare and cookie based stickiness

Hello

I am testing HAproxy behind Cloudflare and i would like to ask if it is possible to use cookie based stickiness ( seems best way to do it? ) using TCP mode or not?

If http mode is needed is there any sample config that will work behind Cloudflare?

Also can i use ssl pass through and cookie based stickiness in http mode?

Thank you

When you need to access and modify HTTP headers, you need HTTP mode, which also means, you cannot use SSL pass-through (which means, passing on already encrypted payload).

There is nothing special regarding Cloudflare, when we are talking about cookie based stickiness. Just refer to some generic cookie based stickiness blog post like this one:

Can i use a custom ssl certificate generated on HAproxy server or i must use a valid Let’s Encrypt domain certificate?

Either Let’s Encrypt or a Cloudflare Origin CA certificate:

Thank you lukastribus !!!

It works great !

How can i use all my 8 cpu cores for HAproxy 2.1 ?

Can i have please a sample code?