These days, to give your clients the best online experience, you must tailor your content to them. IP intelligence gives you a way to analyze IP addresses and gain rich insights about that person’s region. This, in turn, allows you to customize your marketing content, advertisements, and local event announcements.

Digital Element has partnered with HAProxy Technologies to offer an integration that lets you gain IP intelligence on traffic that flows through the HAProxy Enterprise load balancer. Having the industry’s most accurate geolocation data attached to the HTTP requests as they pass through the load balancer makes the job that much easier. HAProxy powers the uptime of leading web applications, including Booking.com, GitHub, Yammer, StackOverflow, Tumblr, Vimeo and Criteo. As the world’s fastest and most widely used software load balancer, HAProxy sets the standard for performance, high availability, and secure delivery of applications across any environment at any scale.

HAProxy Enterprise combines HAProxy with enterprise-class features, services, and premium support. Its position at the edge of the network makes it the perfect place to inspect traffic. Companies already use HAProxy to identify and reject malicious clients, spread work across a cluster of backend servers, and get detailed statistics about the load placed upon their infrastructure. Adding IP intelligence simply takes this to the next level.

Adding NetAcuity Pulse for HAProxy
Installing the NetAcuity Pulse module is quick and easy. Use the system’s package manager to include the HAProxy package repository and then install the module with apt on Ubuntu or yum on CentOS. Read the ​official documentation​ here.

Next, download the NetAcuity database and unzip it to a directory on the load balancer server. Update the HAProxy configuration file to load the module and the database.

Here’s an example:

global

module-path /opt/hapee-1.9/modules

module-load hapee-lb-netacuity.so

netacuity-load 04 /etc/hapee-1.9/netacuity

The ​module-load​ directive installs the NetAcuity module. The ​NetAcuity- load​directive loads the geolocation database into memory. It points to the directory that contains the ​.db​ files. Note that the 04 comes from the filenames inside the NetAcuity​folder.

You can also have HAProxy automatically fetch and apply updates to the database. Add a NetAcuity-update ​directive to the same section, as shown here:

netacuity-update url 04 http://localhost:8000/netacuity timeout 30s

The easiest way to forward the geolocation data to the backend servers is to include it within HTTP request headers that are added to the messages as they pass through. Use the http-request add-header​ directive to append a custom request header. Here’s an example:

listen www_proxy

bind :80

mode http

server s1 127.0.0.1:8080

http-request add-header X-NetAcuity

%[src,netacuity-lookup-ipv4(“edge-city”,”edge-country”)]

The resulting HTTP request header will look like this: ​X-Netacuity: louisville,usa​. You can define multiple properties, as we’ve done here, by separating them with commas.

IP Intelligence Provides Insight for Tailoring Content
Having the ability to add IP intelligence data to HTTP requests as they pass through the HAProxy load balancer is an easy way to learn about your clients so that you can tailor content for them. Offloading this task to your load balancer makes it simple and convenient.