Restrict 80/443 to IP of web application firewall

brgsstm

Member
Jan 22, 2012
9
0
51
cPanel Access Level
Root Administrator
We recently positioned the sites on our cPanel servers behind a web application firewall. We now need to restrict access on 80 and 443 to only the IPs of the WAF. What's the best way to go about this? .htaccess, httpd.conf or iptables? Anything else? Looking for advice on any of these options please?

Any help would be greatly appreciated.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hi @brgsstm

The best way to do this from the server in my opinion would be directly through iptables. The iptables man pages can be seen online here: iptables(8) - Linux man page there are also a number of great guides that detail how to do this.

Thanks!