VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-mitigate-ddos-attacks-against-your-website-with-cloudflare?comment=90214

⇱ How To Mitigate DDoS Attacks Against Your Website with CloudFlare | DigitalOcean


How To Mitigate DDoS Attacks Against Your Website with CloudFlare

Updated on December 22, 2022
👁 How To Mitigate DDoS Attacks Against Your Website with CloudFlare

Introduction

Cloudflare is a company that provides content delivery network (CDN) and distributed DNS services by acting as a reverse proxy for websites. Cloudflare’s free and paid services can be used to improve the security, speed, and availability of a website in a variety of ways.

In this tutorial, you will learn how to use Cloudflare’s free tier service to protect your web servers against ongoing HTTP-based distributed denial of service (DDoS) attacks by enabling “I’m Under Attack Mode”. This security mode can mitigate DDoS attacks by presenting an interstitial page to verify the legitimacy of a connection before passing it to your web server.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Software Engineer @ DigitalOcean. Former Señor Technical Writer (I no longer update articles or respond to comments). Expertise in areas including Ubuntu, PostgreSQL, MySQL, and more.

👁 Milecia McGregor
Milecia McGregor
Author
Senior Technical Writer
See author profile

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

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

This comment has been deleted

Hi Mitchell, Nice tutorial. One of my friend added his website on CloudFlare, but it is making some error.

Any professional advice how to resolve this problem.

I’d highly recommend you remove the wildcard * record as it will leak out the origin server IP, as you don’t have the option of an orange cloud (proxy on) for wildcard records:

$ dig +short example.cockroach.nyc
104.236.3.48

Hey Mitchell, thanks for the Tutorial. I have a little Problem. I’ve added the nameserver 2 weeks ago correctly to my website(panel), but cloudflare still say “Status: Pending”. What could be the Problem there?

Hi, Recently i received a huge bot attack on my website. And cloudflare did not even bat an eye, or give me any notifications. My CPU consumption went upto 100% and it broke my website. The “im under attack mode” did not do any good.

The attack basically used a lot of my php-fpm service, and it crashed. Is there any other service, or program that you can recommend?

PS - i dont use wordpress, but do use php

There where so restrictions that had us back away from CloudFlare. If I recall correctly there are limits on what certificates are allowed and the level of protection with some items we wanted restricted to the $2400+/yr plans.

Apart from the recent “CloudBleed” controversy, this CF thing has been a terrible solution since its inception. I tried it a few years ago. My own traffic, and those of known friends, was being flagged as malicious. To get to my humble site with just about 50 unique visitors a week, CF showed “verify yourself” nonsense.

I think DO needs to invest in a proper DDOS protection like Vultr etc. Otherwise it’s quickly becoming a less attractive service.

Hi Mitchell,

Would anything else need to be done if I have multiple (2) subdomains under digital ocean?

Use the Cloudflare API to automatically turn this feature off to remove attack embankments. A simple script shell provided on linux can work well

Uh no, Don’t use cloudflare, its the most unreliable service ever And it is more bypassable than actual ddos integrated protection itself Yes Cloudflare helps proxy the actual main ip However it does not defend things very well. Their DDOS Protection fails consistently sometimes

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.