Örnek NGINX ayarları : DDOS saldırıları için PHP ve NginX sistemi
nginx.conf
user www-data www-data;
worker_processes 10;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
#keepalive_timeout 0;
keepalive_timeout 5;
tcp_nodelay on;
gzip on;
limit_req_zone $binary_remote_addr zone=antiddosphp:10m rate=1r/s;
limit_req_zone $binary_remote_addr zone=antiddos:10m rate=10r/s;
include /etc/nginx/mustafat/*;
}
virtualhost.conf
<!-- wp:image {"align":"left","id":144} -->
<div class="wp-block-image"><figure class="alignleft"><img src="https://www.kampusnet.com/wp-content/uploads/2014/04/dosvo4-263x300.png" alt="ddos" class="wp-image-144"/></figure></div>
<!-- /wp:image -->
<!-- wp:paragraph -->
<p>Örnek NGINX ayarları : DDOS saldırıları için PHP ve NginX sistemi</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p><strong>nginx.conf</strong></p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code>user www-data www-data;
worker_processes 10;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
#keepalive_timeout 0;
keepalive_timeout 5;
tcp_nodelay on;
gzip on;
limit_req_zone $binary_remote_addr zone=antiddosphp:10m rate=1r/s;
limit_req_zone $binary_remote_addr zone=antiddos:10m rate=10r/s;
include /etc/nginx/mustafat/*;
}</code></pre>
<!-- /wp:code -->
<!-- wp:paragraph -->
<p><b>virtualhost.conf </b></p>
<!-- /wp:paragraph -->
<!-- wp:code -->
<pre class="wp-block-code"><code></code></pre>
<!-- /wp:code -->
<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>server {<br>root /home/www-data/gsxx.com;<br>listen 80;<br>server_name gsxx.com;<br>access_log off;<br>location / {<br>index index.php index.html index.htm;<br>limit_req zone=antiddos burst=10;<br>}<br>location ~ \.php$ {<br>fastcgi_pass unix:/tmp/php-fpm.sock;<br>fastcgi_index index.php;<br>include fastcgi_params;<br>fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>fastcgi_read_timeout 1800;<br>fastcgi_param SERVER_NAME $http_host;<br>fastcgi_ignore_client_abort on;<br>limit_req zone=antiddosphp burst=2;<br>}<br>}</p></blockquote>
<!-- /wp:quote -->