Using NGINX to prevent DDoS Attacks Nginx, a highly popular server system for Unix machines, comes with enough built-in functionality to greatly limit the effectiveness of DDoS attacks. These features could handle a DDoS attack by regulating the incoming traffic and by controlling the traffic as it is proxied to backend services.
Before you change any settings, make sure you make a quick backup of your server’s configuration. The following command works for this:
sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.backup-original Nginx worker connections One of the important parameters that we tweak is the number of worker process and number of worker connections in the Nginx configuration file /etc/nginx/nginx.conf.
We’ll gradually adjust the worker process and worker connections to a higher or lower value for handling DDoS attacks.