Online Casino DDoS Protection: Cloudflare and Peak Matches
Online casino and sportsbook DDoS protection: origin only through Cloudflare, rate limits on login and bets, lite mode, monitoring and a load drill.
On this page
Online gambling is one of the industries most targeted by DDoS, and the attacks land in the most expensive hours: a final, a derby, a major tournament. After these steps your server answers nothing but the protection layer, login, registration and betting are covered by rate limits, under attack the platform switches off the heavy features and keeps the essentials, and you have a ready procedure for the "pay up or we take you down" email.
Plan
| Step | What we do | Time |
|---|---|---|
| 1 | Map everything that is visible from outside | 2 hours |
| 2 | Hide the server address: access only through the protection layer | 1 day |
| 3 | Set up rules and rate limits in Cloudflare | 1 day |
| 4 | Protect the betting API and login at the application level | 1 week |
| 5 | Separate payment notifications and service endpoints | 2 hours |
| 6 | Prepare a "lite mode" for the platform | 1 week |
| 7 | Set up monitoring and alerts | 2 hours |
| 8 | Prepare procedures for peak matches and for the extortion email | 2 hours |
| 9 | Run a load drill on your own staging environment | 1 day |
What real attacks have shown
- Cloudflare, 2025: in Q1 "gambling and casinos" was the most attacked industry, in Q4 the third; throughout the year the industry stayed near the top of the list.
- Cloudflare, Q2 2025: of those who could name the attacker, 63% pointed to competitors — especially often in gaming, gambling and crypto.
- According to Cloudflare reports, record attack sizes in 2025 grew to tens of terabits per second — your own uplink cannot absorb that, only protection on the provider side can.
What follows from this:
- Attackers hit whatever is visible from outside, including forgotten subdomains → the map (step 1).
- Protection is useless if the server answers directly → access only through the protection layer, a new server address (step 2).
- Application-layer attacks look like normal requests → per-address limits, not just "DDoS protection" (steps 3–4).
- An attack during a peak match hits revenue → lite mode and a match-day procedure (steps 6, 8).
- Competitors and extortionists write in advance → a procedure for the email (step 8).
Step 1. Map everything that is visible from outside
How to do it.
| Address | What it is | Through protection? | Cacheable? |
|---|---|---|---|
www. |
website | ||
api. |
player API, bets | no | |
m. / mobile app API |
no | ||
ws. |
WebSockets: odds, live | no | |
pay-callback. |
payment provider notifications | no | |
admin. / back office |
no | ||
static., cdn. |
images, scripts | yes | |
| mail, VPN, monitoring | — |
Find forgotten subdomains in certificate transparency logs:
curl -s "https://crt.sh/?q=%25.<your_domain>&output=json" | jq -r '.[].name_value' | sort -u
Done when: every subdomain is in the table and you know whether it goes through the protection layer.
Step 2. Hide the server address: access only through the protection layer
How to do it.
- All web addresses from step 1 go through Cloudflare (orange cloud in DNS).
- The server accepts 80/443 only from Cloudflare addresses — as in the article Exchange website, step 7.
- Change the server address if it was ever exposed directly: the old address may persist in DNS history and in scanner databases.
- The mail server and other services are not on the same address as the web server: the MX record often gives away the server address.
- The back office is not public: access through a VPN or Cloudflare Access with two-factor login.
Check from an external machine:
curl -sk -m 10 -o /dev/null -w "%{http_code}\n" https://<server_IP>/ -H "Host: www.<your_domain>"
Expected result: a timeout (000).
Done when: the server does not answer directly, the address is new, the back office is closed.
Step 3. Set up rules and rate limits in Cloudflare
How to do it — Security → WAF (section names change, check against the Cloudflare documentation):
- DDoS rules (managed) — enabled by default; make sure they have not been weakened.
- Rate limiting rules on expensive endpoints:
| Endpoint | Threshold (example) | Action |
|---|---|---|
/api/login |
10 requests per minute per IP | block for 10 minutes |
/api/register |
5 per minute per IP | managed challenge |
/api/bet |
60 per minute per IP | block |
/api/password-reset |
3 per minute per IP | block |
| whole site | 600 per minute per IP | managed challenge |
Tune the thresholds to your normal traffic: mobile carriers put many legitimate players behind one address. 3. Custom rules: block methods the site does not use; countries where you do not operate get a challenge (for an international license this is also the requirement not to admit Georgian citizens — but blocking by country does not replace an ID document check, see online casinos in Georgia, step 4). 4. Bot protection — enabled for the login and registration pages. 5. I'm Under Attack mode — off by default; for the whole zone it is switched on in Quick Actions on the zone Overview page, for individual paths with a configuration rule. It is written down who is allowed to turn it on.
What is available on which plan (per Cloudflare documentation, November 2026):
| Free | Pro | Business | |
|---|---|---|---|
| DDoS protection (layers 3–7, unmetered) | yes | yes | yes |
| WAF custom rules | 5 | 20 | 100 |
| Rate limiting rules | 1 | 2 | 5 |
| Counting period | 10 s | up to 1 min | up to 10 min |
| Mitigation timeout | 10 s | up to 1 h | up to 1 day |
The five limits from item 2, counted "per minute" with a 10-minute block, fit in full only on Business. On Free and Pro, combine the most expensive endpoints (login, password reset) into one or two rules and limit the rest in the application (step 4). Enterprise limits depend on the contract.
Done when: limits on expensive endpoints work and the procedure for enabling I'm Under Attack mode is written down.
Step 4. Protect the betting API and login at the application level
How to do it.
- Per-account limits, not just per-IP: how many bets, logins and odds requests per minute a single player can make.
- A queue for heavy operations (bet settlement, withdrawals) instead of synchronous processing.
- Cache odds and event lists for a short time (1–2 seconds) — even a few seconds of cache take off most of the load.
- Request size limits and timeouts in Nginx:
client_max_body_size 1m;
client_body_timeout 10s;
client_header_timeout 10s;
limit_req_zone $binary_remote_addr zone=api:20m rate=20r/s;
location /api/ { limit_req zone=api burst=40 nodelay; proxy_pass http://app; }
Behind Cloudflare, $binary_remote_addr is a Cloudflare address; you need the real client address (real_ip_header CF-Connecting-IP, as in the article on the exchange website, step 7).
Done when: per-account limits work and odds are cached.
Step 5. Separate payment notifications and service endpoints
How to do it.
- Payment provider notifications go to a separate address, only from the provider's addresses (the provider has the list), with no cache and no challenge.
- The connection to the regulator's monitoring system and to game providers gets separate addresses and rules so that the step 3 limits do not hit them.
- Check that these flows keep working while I'm Under Attack mode is on.
Done when: payment notifications and service flows do not pass through a challenge and work with protection at maximum.
Step 6. Prepare a "lite mode" for the platform
How to do it. A feature flag that during an attack:
- switches off the heavy parts: search, history, recommendations, animations, secondary live streams;
- keeps the essentials: login, balance, bets on key events, withdrawals;
- shows players a "temporarily limited mode" banner.
Who turns it on, at which metrics, and how to roll back — written down.
Done when: lite mode is turned on with a single action and has been tested on staging.
Step 7. Set up monitoring and alerts
How to do it.
- Cloudflare attack alerts (Notifications → DDoS alerts) go to the on-call engineer.
- Server metrics: requests per second, share of 5xx responses, betting API response time, queue length.
- An external check from a different provider every minute: home page, login, betting API.
- The "this is an attack" threshold is written down: for example, 5xx above 5% for two minutes or bet response time above 2 seconds.
Done when: a test threshold breach alerts the on-call engineer within a minute.
Step 8. Prepare procedures for peak matches and for the extortion email
How to do it.
Before a major event:
- Release freeze 24 hours before.
- On call: DevOps, betting API developer, Cloudflare and hosting support contacts.
- Check: I'm Under Attack mode and lite mode are available, contacts are up to date.
The "pay up or we take your site down" email:
- Do not pay and do not reply. Paying does not guarantee there will be no attack and makes you a target.
- Save the email with headers, addresses, wallets.
- Raise protection in advance: tighten the step 3 limits, have people on call for the time named in the email.
- Report it to the police and to your protection provider.
Done when: the procedure is printed, and the on-call and provider contacts are filled in.
Step 9. Run a load drill on your own staging environment
How to do it.
- Only your own infrastructure, and with permission from your hosting provider and Cloudflare: load against someone else's site is an attack.
- Staging, a copy of the platform, a separate domain; generate load with a tool like k6 using a "login + bet" scenario:
import http from 'k6/http';
export const options = { stages: [{ duration: '2m', target: 200 }, { duration: '5m', target: 1000 }, { duration: '2m', target: 0 }] };
export default function () {
http.post('https://staging.<your_domain>/api/login', JSON.stringify({ user: 'test', pass: 'test' }), { headers: { 'Content-Type': 'application/json' } });
http.get('https://staging.<your_domain>/api/odds?event=123');
}
- Watch: where response time grows first, whether the limits trigger, whether lite mode works, whether alerts arrive.
- Write a report: at what load what breaks, what we change.
Done when: the drill has been run, weak spots are recorded and fixed.
Checklist
| # | What to check | How to verify | ☐ |
|---|---|---|---|
| 1.1 | All subdomains are in the table | Run the crt.sh command from step 1 — every subdomain found is in the table | ☐ |
| 1.2 | For every address you know whether it goes through protection | The "Through protection?" column is filled in on every row | ☐ |
| 1.3 | Forgotten subdomains are removed | Subdomains with no owner found are deleted from DNS or moved behind protection | ☐ |
| 2.1 | All web addresses are proxied by Cloudflare | In the DNS section every web record has the orange cloud; dig +short www.<your_domain> returns Cloudflare addresses, not your server |
☐ |
| 2.2 | The server does not answer directly | The curl command from step 2 from an external machine returns 000 (timeout) |
☐ |
| 2.3 | The server address is new and mail does not give it away | The server address does not appear in your domain's DNS history; the address from dig +short MX <your_domain> is not the web server address |
☐ |
| 2.4 | The back office is closed | Open the back office address in a normal browser without VPN — Cloudflare Access login page or no response | ☐ |
| 3.1 | Managed DDoS rules are not weakened | The zone's DDoS protection settings have no overrides that lower sensitivity, or each one has a recorded reason | ☐ |
| 3.2 | The login limit triggers | 15 requests to /api/login within a minute from one test address — after the threshold, a 429 response or a block |
☐ |
| 3.3 | Bot protection is on for login and registration | Security analytics shows challenges and hits on /api/login and /api/register |
☐ |
| 3.4 | It is written down who turns on I'm Under Attack mode | The attack procedure lists names and phone numbers of those allowed to enable the mode and where it is enabled | ☐ |
| 4.1 | The per-account limit works | A test player places more bets per minute than the limit — extra requests are rejected, other test players are not affected | ☐ |
| 4.2 | Odds are cached | Two odds requests in a row — the application log shows one calculation, the second response comes from cache | ☐ |
| 4.3 | Nginx sees the real client address | The Nginx access log shows player addresses, not Cloudflare ranges | ☐ |
| 4.4 | Large requests are rejected | A request with a 2 MB body to /api/ returns 413 |
☐ |
| 5.1 | Payment notifications are accepted only from the provider | A request to the notification address from an outside address is refused; a test notification from the provider is accepted | ☐ |
| 5.2 | Service flows work with protection at maximum | In a maintenance window turn on I'm Under Attack mode — a test payment and the connection to game providers go through | ☐ |
| 6.1 | Lite mode turns on with a single action | On staging, turn on the flag — search and history are off; login, balance, bets and withdrawals work; the banner is visible | ☐ |
| 6.2 | When to turn it on and how to roll back is written down | The attack procedure lists the trigger metrics, the owner and the rollback steps | ☐ |
| 7.1 | Cloudflare attack alerts reach the on-call engineer | Notifications has a DDoS alert rule with the on-call address | ☐ |
| 7.2 | The external check runs every minute | The monitoring service at another provider has checks of the home page, login and betting API at a 1-minute interval | ☐ |
| 7.3 | The "this is an attack" threshold alerts within a minute | A test threshold breach on staging — the on-call engineer got an alert within a minute | ☐ |
| 8.1 | The major-event procedure is printed | The printout has the release freeze, on-call staff with phone numbers, Cloudflare and hosting support contacts | ☐ |
| 8.2 | The on-call engineer knows what to do with an extortion email | Ask: "An email says pay up or we take the site down. What do you do?" — does not reply, saves the email with headers, raises protection, tells their manager | ☐ |
| 9.1 | The drill ran only on your own staging and with permissions | There are written permissions from the hosting provider and Cloudflare; load went to the separate staging domain | ☐ |
| 9.2 | The drill report is closed | The report lists at what load what broke; every finding is marked "fixed" | ☐ |
Questions
Is the Cloudflare free plan enough?
Protection against large network-layer attacks is included on the free plan too; rules, rate limits, API protection and support during an attack differ across the paid plans. For an online casino during peak events, look at support and rate limits, not just the price.
How do I tell a DDoS from a rush of players before a match?
In a rush, logged-in players send more requests to the usual endpoints — odds, bets, balance — and the number of bets goes up. In an attack, requests hammer one or two endpoints (login, search, home page), come without a session and often from countries where you have no players, and the number of bets stays flat or drops. Compare with past matches in Cloudflare analytics and in the step 7 metrics.
The attack is already underway and there is no protection. What do I do right now?
Moving DNS to Cloudflare is not enough: the attackers already know the old server address and will keep hitting it directly. The order is: a new server address, which accepts 80/443 only from Cloudflare addresses (step 2), then DNS records through Cloudflare with the orange cloud. In parallel, call your hosting provider's support: they may have their own filtering.
Our hosting provider took our server offline during an attack. Does that happen?
Yes: many hosting providers, when a large attack hits, route the targeted address to nowhere (blackhole) to protect their other customers, and the site disappears even though the server is fine. Ask your provider in advance at what volume they do this and how quickly they restore the address. If the server address was never exposed and accepts only Cloudflare traffic (step 2), the attack is filtered before it reaches the hosting provider, and finding the address to hit directly is much harder for attackers.
We turned on I'm Under Attack mode and the mobile app stopped working. Why?
The mode shows an interstitial challenge page that a browser with JavaScript passes. The app and the site's scripts expect a JSON response from the API, get an HTML page instead, and the request fails: Cloudflare warns that challenges do not work for AJAX and XHR requests. So enable the mode with a configuration rule for web pages only, and protect the API with rate limits and per-account limits (steps 3–4).
Are the WebSockets carrying odds protected too?
Cloudflare proxies WebSockets on all plans, but WAF rules and rate limits inspect only the connection handshake — messages inside the connection are not inspected. Set a per-connection message limit and a per-account connection limit in the application (step 4). Cloudflare occasionally restarts its servers and drops connections, so the client must reconnect after a random delay, not all players in the same second.
The target is not the website but a streaming server or another non-HTTP service. How do we cover it?
The regular Cloudflare proxy protects only web traffic. For other TCP and UDP applications Cloudflare has Spectrum — on paid plans, with arbitrary TCP/UDP applications only on Enterprise; other providers call this network-level protection. The principle is the same as in step 2: nobody sees the real address of the service, and it accepts only traffic from the protection layer.
Our server is in our own data center in our country — do we need protection abroad?
Powerful attacks saturate your link to the server, and they have to be filtered before it — at the protection provider. Edge protection does not move the game or the data to the provider: it filters traffic and passes requests on to your server. If the regulator requires game servers to stay in the country (for Georgia sources disagree on this — see online casinos in Georgia), check with a lawyer and the regulator whether there are restrictions on routing player traffic through a foreign provider.
We are not on Cloudflare. Do the steps still apply?
Yes, only the menu names change. With any protection provider check the same things: the server answers only the provider's addresses (step 2), there are rate limits on expensive endpoints and a browser check at login (step 3), attack alerts arrive and there is a support contact for match time (steps 7–8).
How often should we run a load drill?
Before the season of major tournaments and after significant platform changes — a new betting API, a change of hosting or protection provider; if nothing changed, at least once a year. Every time only on your own staging and with the providers' permission (step 9).
Note: Based on Cloudflare reports and documentation. Load tests only on your own infrastructure and with the providers' permission.
Sources
- Cloudflare Radar — DDoS threat reports 2025 (Q1: gambling and casinos the most attacked industry; Q4: third place)
- SecurityBrief — Cloudflare warns of 358% surge in global DDoS attacks in 2025
- Cloudflare Docs — Rate limiting rules (number of rules, periods and mitigation timeouts by plan)
- Cloudflare Docs — WAF custom rules (number of rules by plan)
- Cloudflare Docs — DDoS Protection (available on all plans, unmetered)
- Cloudflare Docs — I'm Under Attack mode
- Cloudflare Docs — Challenge pages (challenges do not work for AJAX/XHR requests)
- Cloudflare Docs — WebSockets (all plans; WAF inspects only the connection handshake)
- Cloudflare Docs — Spectrum (TCP/UDP applications, paid plans; arbitrary ones on Enterprise)