Stop people from accessing through IP.

Posted July 30, 2018 2.6k views
DNSUbuntu 18.04

I have a droplet with the public ip and ubuntu running apache.

I have cloudflare for ssl.

People access my website through
and it is secured.

But people can also access it through the public ip

How do I stop that?

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.

Submit an Answer
2 answers

Hello friend!

You can block all traffic to the web server in your firewall, and then allow traffic from these IP ranges:

This will ensure that your web server can only be reached through CloudFlare.

Kind Regards,

Your link shows bunch of ips. What do you actually do with them to stop accessing IP other than your own domain?
Is there any more information on this somewhere?
Someone is using my IP address to host his sub-domain.