HAProxy community

Overide defaults


Hello Everyone

So I have a basic question. Can the value in defaults be overwritten in the backend or frontend?

My problem is I have a new app which needs a longer client/server timeout than the default which in my case is a 60s. I have read that to do this I need to remove timeout client from defaults and add them for each frontend and obviously setting me new app timeout to the desired time. Is ths correct ?

Heres my relevant config.

  log  global
  maxconn  8000
  option  httplog
  option  redispatch
  option  log-separate-errors
  retries  3
  stats  enable
  timeout  http-request 10s
  timeout  queue 1m
  timeout  connect 10s
  timeout  client 1m
  timeout  server 1m
  timeout  check 10s

frontend rabbit
  bind 10.0.01:5672
  mode tcp
  timeout client 3h
  timeout server 3h
  option dontlog-normal
  option dontlognull
  default_backend rabbit_backend
backend rabbit_backend
  balance roundrobin
  mode tcp
  server rabbitserver1 check
  server rabbitserver2 check


Overwriting it in the frontend or backend should work just fine. If you need to disable certain options, I believe you can use the no keyword (“no option redispatch”) for example.

There is no need to remove the options in the default section.

If I remember correctly, you can also use multiple default sections, which will be valid for backend/frontend/listen sections below it.

timeout server 5s

backend fastbackend

timeout server 1m

backend slowbackend


I should have mentioned , that I have tried setting the timeout in both backend and frontend but the timeout is still taking affect.



Ok I mange to get this working by adding the timeout to the backend and frontend. In my previous test I only added the timeout to either the backend or frontend which did not work for me. Thanks for the help @lukastribus


Well that depends, “timeout server” belongs to the backend for example. It is not inherited from the frontend (but only from the default section), vice versa “timeout client”.


@lukastribus makes sense. I changed my config to match you suggestion timeout server for backend and timeout client for frontend and it works as expected. Thanks for the help :slightly_smiling_face: