Question

How to Whitelist Ips (Ezoic)

I have hosted my WordPress site on DigitalOcean Droplet along with Cloudflare. I am trying to integrate Ezoic with it. But after integration, I am getting Error 502 whenever I am trying to visit my website. When I contacted Ezoic, they told me that I have to whitelist Ezoic IPs in my host i.e. DigitalOcean. They told me that my connection is a proxy NameServer connection i.e. in my case, my Name Servers are with Cloudflare, and a reverse proxy with Ezoic is present. Can anyone help in solving this issue because I am new to all this? Can you tell me how to whitelist IPs in DigitalOcean droplet with WordPress?

The server is Apache2

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @hellohello589,

You can whitelist IP addresses on your Droplet using IPTABLES. Good thing is DigitalOcean have a pretty good tutorial on how to work with IPTABLES. Here is the article:

https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands

For instance, if you wish to allow an IP address to your firewall you can se use the following commands

iptables -I INPUT -p tcp -s XXX.XXX.XXX.XXX -j ACCEPT
iptables -I OUTPUT -p tcp -d  XXX.XXX.XXX.XXX -j ACCEPT`

Please note you need to change XXX.XXX.XXX.XXX with the actual IP addresss. Additionally, the above commands will allow access to every port for the given IP Address.

If you want to give access only to IP only on a specific port, you can use

iptables -I INPUT -p tcp -s XXX.XXX.XXX.XXX tcp --dport 80 -j ACCEPT

Regards, KFSys