# Dynamic server selection

**URL:** <https://discourse.haproxy.org/t/dynamic-server-selection/149>\
**Category:** Help!\
**Created:** [March 2, 2016, 4:17pm UTC](https://discourse.haproxy.org/t/dynamic-server-selection/149 "2016-03-02T16:17:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ahayworth](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ahayworth/32/11_2.png) [@ahayworth](https://discourse.haproxy.org/u/ahayworth)\
**Post date:** [March 21, 2016, 9:16pm UTC](https://discourse.haproxy.org/t/dynamic-server-selection/149/2 "2016-03-21T21:16:22Z")

</div>

Hi curtoni -

I think you need to spell out your servers in the backend, and use a different keyword to choose which specific one. Maybe something like:

```auto
backend dynamic
  use-server %[lua.choose_server]
  server s1 <ip>
  server s1 <ip>

```

I haven’t tested the config, so you may need to play around with it.

Here’s docs on the use-server keyword: [https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#4.2-use-server](https://cbonte.github.io/haproxy-dconv/configuration-1.6.html#4.2-use-server)

Hope that helps!

- Andrew

---

_[View the full topic](https://discourse.haproxy.org/t/dynamic-server-selection/149)._
