# Ordering of configuration commands

**URL:** <https://discourse.haproxy.org/t/ordering-of-configuration-commands/74>\
**Category:** Help!\
**Created:** [January 19, 2016, 6:47pm UTC](https://discourse.haproxy.org/t/ordering-of-configuration-commands/74 "2016-01-19T18:47:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdarwin](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sdarwin](https://discourse.haproxy.org/u/sdarwin)\
**Post date:** [January 19, 2016, 6:47pm UTC](https://discourse.haproxy.org/t/ordering-of-configuration-commands/74/1 "2016-01-19T18:47:56Z")

</div>

Hello,

I believe I may have found a bug, and if so not sure where to report it. Your feedback is very much appreciated.

So, here it goes. This config will check every 5s interval.

backend www  
mode http  
default-server inter 5s fall 3 rise 2  
server test 1.2.3.4:80 check

and this config will check every 2s interval.

backend www  
mode http  
server test 1.2.3.4:80 check  
default-server inter 5s fall 3 rise 2

why? 🙂 Shouldn’t it be 5s for both?

HAProxy version 1.6.3, released 2015/12/25

Thanks,  
Sam

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [January 19, 2016, 9:01pm UTC](https://discourse.haproxy.org/t/ordering-of-configuration-commands/74/2 "2016-01-19T21:01:14Z")

</div>

This is simply related to the way HAProxy parses a configuration file.  
I think the documentation is not accurate enough and should report that `default-server` applies for the servers below it, (and mybe until the next `default-server` directive).

---

<div class="post-metadata">

**Author:** ![sdarwin](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sdarwin](https://discourse.haproxy.org/u/sdarwin)\
**Post date:** [January 20, 2016, 8:22am UTC](https://discourse.haproxy.org/t/ordering-of-configuration-commands/74/3 "2016-01-20T08:22:42Z")

</div>

That is surprising.

The official Chef cookbook got it wrong [GitHub - sous-chefs/haproxy: Development repository for the haproxy cookbook](https://github.com/hw-cookbooks/haproxy)

> the documentation is not accurate enough and should report

configuration.txt is 15,000 lines long and so it will be a needle in a haystack. I wonder if a warning message at startup would make sense. Or, if the code should change, since this is a configuration file, and they are usually not dependent on ordering. … unless this is an intentional feature, which it may be.

---

<div class="post-metadata">

**Author:** ![Baptiste](https://avatars.discourse-cdn.com/v4/letter/b/cab0a1/32.png) [@Baptiste](https://discourse.haproxy.org/u/Baptiste)\
**Post date:** [March 22, 2016, 7:51pm UTC](https://discourse.haproxy.org/t/ordering-of-configuration-commands/74/4 "2016-03-22T19:51:29Z")

</div>

No warning message, since this type of configuration may be valid in some cases.
