Search code examples
haproxy

HAProxy use urls in server config?


Right now, my config looks like this:

server node1 10.20.x.y:80 check
server node2 10.20.x.y:80 check
server node3 10.20.x.y:80 check

What would be the best way to use URLS here instead of IPs?

Something like (But this does not seem to work):

server node1 url-1.google.com:80 check
server node2 url-2.google.com:80 check
server node3 url-3.google.com:80 check

Solution

  • I think I may have posted this question on the wrong site.

    I have posted this question on Serverfault aswell and received the following answer:

    When you want to use DNS resolution you will need to specify a "resolvers" section where you configure DNS.

    Which worked for me.