F
F
frotchn2022-02-25 22:39:51
PHP
frotchn, 2022-02-25 22:39:51

HAProxy returns 400 after httpchk but endpoint response is 200. What's the problem?

Good day.
haproxy version 1.5.18
rhel 7.5
conf:

listen server
    bind *:5000
    bind-process 1
    balance leastconn
    hash-type consistent
    fullconn 1024
    option forwardfor
    http-send-name-header Host
    stick-table type ip size 1m expire 1h
    stick on src
    option httpchk HEAD /test/version HTTP/1.0\r\nHost:localhost
    server server1 server_ip:8080 check inter 3s fall 3 rise 2
#препрод для теста
    server server2 server_ip:8080 check inter 3s fall 3 rise 2


Problem:
When requesting via
curl -D - -s server:5000/test/version
response
HTTP/1.1 200

But haproxy itself logs L7STS/400 response

How to do healht check in such cases?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2016-04-04
@SuperDoker

As planned, the code outputs a random number from 0 to 14 based on the input value "4656" and the number of the current round "3".
The idea behind the code is to have both randomness and repeatability at the same time.
That is, if you replace "4656" with another value, then other numbers will "fall out" in the rounds, and if you substitute "4656" again, then the numbers will "fall out" exactly the same.

A
Alex, 2016-04-04
@streetflush

php.net/manual/ru/function.md5.php
php.net/manual/ru/function.hash.php
php.net/manual/ru/function.substr.php
php.net/manual/ru/function.hexdec .php
What is not clear from this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question