Hello Lukas,

Thank you very much for your reply!

The "mode http" does work fine when I access the [HAProxy server (192.168.0.131:9000)](192.168.0.131:9000) straight from the webbrowser. - the log: 192.168.0.131 local0 haproxy 192.168.0.108:54119 [27/Mar/2025:09:16:09.586] public public_backend/web01 0/0/6/5/11 404 400 - - --VN 3/3/0/0/0 0/0 "GET / HTTP/1.1" - opening a new private window causes the public_backend/web01 to change to public_backend/web02 or public_backend/web03 . A refresh of any window adds an entry for that particular public_backend/webxx server . So this is working 100% as intended.


This doesn't work when I do this through a curl request in php. There is no session added in the "statistics report" page. Note that the curl setup in php works fine when accessing the Omnis server directly, so there is no faulty php code. - the log when I try via curl: 192.168.0.131 local0 haproxy 192.168.0.61:54073 [27/Mar/2025:09:17:24.253] public public/<NOSRV> -1/-1/-1/-1/0 400 0 - - PR-- 1/1/0/0/0 0/0 "<BADREQ>"

The "mode tcp" resolved the above issue but it provides me with other limitations (as mentioned initially).

Thanks again for your reply and effort!

Kind regards,
Dimitri

On 26 Mar 2025, at 18:16, Lukas Tribus wrote:

Hello,


On Wed, 26 Mar 2025 at 16:32, haproxy <hapr...@arcict.com> wrote:

My question(s):

how can I capture the PHPSESSID in the HAProxy config?

You need to be in "mode http", otherwise you cannot access HTTP
headers or HTTP cookies, required to use session stickiness.



maybe out of the scope of HAProxy: is there a way to use "mode http" with the curl_setopt() php function?

curl_setopt() is just a PHP function to set curl options.

Are you just trying to say that you are using curl in php and it doesn't work?

Or are you trying to say you are using a special curl option (using
curl_setopt() ), and in this case it does not work?


Either way, you need to put haproxy in http mode and httplog mode and
provide more context when things fail in this configuration, including
haproxy http logs.


Lukas

Reply via email to