HAProxy config - how does rancher interpret the config in yaml

I am fairly new to rancher so maybe I am missing something however I am struggling to find an explanation of how Rancher takes the config defined in the config: section of lb_config: of the rancher-compose.yaml and adds it to the basic config.
I am trying to add in some redirects , BASIC Auth and a specific section to present a pseudo http 200 response for Azure application gateway probe. However I am struggling to get the config section to generate a haproxy.cfg with the required configuration. Some sections dont even appear depending on which order I place them.
Any advice would be welcome.