Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4731

Key-value mapping: Route by IP

$
0
0

@Cyberfusion wrote:

I am using a key - value mapping in HAProxy like this:

use_backend %[req.hdr(host),lower,map_dom(/etc/haproxy/clusters.map)] if !letsencrypt-acl

/etc/haproxy/clusters.map is filled with domain and backend mappings. This works well.

Now, I also need to be able to route by IP. In other words, I want to be able to add an IP to the map file (/etc/haproxy/clusters.map) with a corresponding backend. In order to do this, I changed my config to:

use_backend %[req.hdr(host),lower,map_dom(/etc/haproxy/clusters.map)] if !letsencrypt-acl
use_backend %[req.hdr(ip),lower,map_dom(/etc/haproxy/clusters.map)]
use_backend bk_letsencrypt if letsencrypt-acl

This actually seems to work well, but is this the recommended way to go about this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4731

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>