I want to put the static pictures on the website into spacing and enable CDN acceleration, and use the URL of the CDN endpoint to access the pictures in the code. How can I limit the traffic of the CDN and the number of visits within a certain period of time when the website is accessed or even attacked on a large scale?
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!
Accepted Answer
Hello @joejo
To limit traffic and requests for your static assets, you can use CDN rate limiting and DDoS protection. Rate limiting can be implemented using third-party CDN providers like Cloudflare, which allows you to set custom rules for traffic and requests mitigation. You can also explore the Cloudflare firewall settings to block or challenge requests matching specific criteria.
Additionally, consider enabling DDoS protection services, like DigitalOcean’s Cloud Firewall, to protect your website from potential attacks. Cloud Firewalls are free and perfect for staging and production deployments.
https://www.digitalocean.com/products/cloud-firewalls
Have in mind you can implement additional rules on your droplet as well. If you run iptables
you can set certain rules or have your web-server (Apache/Nginx) to block access to specific resources.
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
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
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.