Skip to main content
Version: 2.17

Enable IP Filter Behind AWS Load Balancer

This document explains how to enable IP filter for Ant Media Server behind a load balancer in AWS. Follow the instructions below.

  1. Edit the following file with a text editor.
vim /usr/local/antmedia/conf/jee-container.xml
  1. Find the line:
<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">

And add the following line before it.

<bean id="valve.access" class="org.apache.catalina.valves.RemoteIpValve" />
  1. Find the line:
<property name="rotatable" value="true" />

and add the following line before it.

<property name="requestAttributesEnabled" value="true" />
  1. After adding these lines, restart Ant Media Server using the following command.
service antmedia restart

The final edited version of the file will look like the following.

<bean id="valve.access" class="org.apache.catalina.valves.RemoteIpValve" />
<bean id="valve.access" class="org.apache.catalina.valves.AccessLogValve">
<property name="directory" value="log" />
<property name="prefix" value="${http.host}_access" />
<property name="suffix" value=".log" />
<property name="pattern" value="common" />
<property name="rotatable" value="true" />
<property name="requestAttributesEnabled" value="true" />

Now, You can use the IP filter.




🔐 Secure Streaming with IP Filtering Behind AWS Load Balancer

By enabling IP filtering behind your AWS Load Balancer, you've added an extra layer of security to your Ant Media Server deployment. This configuration ensures that only trusted IP addresses can access your streaming services, protecting your infrastructure from unauthorized access and potential threats.