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

Haproxy errorfile + keepalive?

$
0
0

@vikas wrote:

We occasionally use haproxy to return a static API response (using the errorfile directive).
However, we’ve noticed that when we do so, haproxy closes the connection (instead of respecting the Connection: Keep-Alive header).

Is there any way to get haproxy to keep the connection alive, instead of closing it right away?

I’ve tried various permuations of setting option http-keep-alive, option httpclose, forcepersist, to no avail. We use haproxy 1.8.

Here’s the backend configuration:

### backend for blackholing heartbeats
backend mybackend
  mode http
  errorfile 503 /srv/www/response.http

Here are the contents of the errorfile:

HTTP/1.1 200 Ok
Content-Type: application/json; charset=utf-8
Connection: Keep-Alive
Content-Length: 17

{"success":false}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



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