Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Web Server
  • Search

* Tips * Limit DDOS risk

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
mephivio
Posts: 198
Joined: Thu Mar 27, 2014 7:35 am

Os: Debian 8x
Web: nginx + php-fpm
* Tips * Limit DDOS risk
  • Quote

Post by mephivio » Sat Sep 23, 2017 5:00 pm

Idea : limit 100 requests or connects per ip

vi /etc/nginx/nginx.conf

at the begining of the http, add:

#Max request per ip
limit_req_zone $binary_remote_addr zone=flood:10m rate=100r/s;
limit_req zone=flood burst=100 nodelay;
#Max Connect per ip
limit_conn_zone $binary_remote_addr zone=ddos:10m;
limit_conn ddos 100;

Then, Restart NGINX via service nginx restart

thanks to Noobunbox
Top

mehargags
Support team
Posts: 1096
Joined: Sat Sep 06, 2014 9:58 pm
Contact:
Contact mehargags
Website Skype

Os: Debian 8x
Web: apache + nginx
Re: * Tips * Limit DDOS risk
  • Quote

Post by mehargags » Sun Sep 24, 2017 11:06 am

Good information.
Thank you
Top

hassaan
Posts: 5
Joined: Thu Jun 28, 2018 9:17 am

Os: CentOS 6x
Web: apache + nginx
Re: * Tips * Limit DDOS risk
  • Quote

Post by hassaan » Sat Jun 30, 2018 7:08 pm

Are sure this will work fine with cloud-flare?
Top

dreiggy
Posts: 154
Joined: Thu May 17, 2018 8:05 pm
Contact:
Contact dreiggy
Skype

Os: CentOS 6x
Web: apache + nginx
Re: * Tips * Limit DDOS risk
  • Quote

Post by dreiggy » Fri Jul 06, 2018 9:49 pm

hassaan wrote: ↑
Sat Jun 30, 2018 7:08 pm
Are sure this will work fine with cloud-flare?
I think maybe it will work if You restore original visitors IP: https://support.cloudflare.com/hc/en-us ... ith-Nginx-
Top

hassaan
Posts: 5
Joined: Thu Jun 28, 2018 9:17 am

Os: CentOS 6x
Web: apache + nginx
Re: * Tips * Limit DDOS risk
  • Quote

Post by hassaan » Sat Jul 07, 2018 5:27 am

dreiggy wrote: ↑
Fri Jul 06, 2018 9:49 pm
I think maybe it will work if You restore original visitors IP: https://support.cloudflare.com/hc/en-us ... ith-Nginx-
Yes, original IP is already restoring via nginx config But I have question.

1. I have to put request limit config lines after the following code or before the following code? Does this will matter?

Code: Select all

# use any of the following two
real_ip_header CF-Connecting-IP;
2. Can you post request limit config code for Apache?
Top

dreiggy
Posts: 154
Joined: Thu May 17, 2018 8:05 pm
Contact:
Contact dreiggy
Skype

Os: CentOS 6x
Web: apache + nginx
Re: * Tips * Limit DDOS risk
  • Quote

Post by dreiggy » Sat Jul 07, 2018 10:55 pm

hassaan wrote: ↑
Sat Jul 07, 2018 5:27 am
1. I have to put request limit config lines after the following code or before the following code? Does this will matter?

Code: Select all

# use any of the following two
real_ip_header CF-Connecting-IP;
2. Can you post request limit config code for Apache?
1. I cannot tell ;) Need to try. But I think You should add after IP restoration.
2. I too never try limiting bandwitch, but You can refer to this apache documentation article. You can try to create global include in conf.d directory for example limit_conn.conf with something like this:

Code: Select all

<Location "/">
    SetOutputFilter RATE_LIMIT
    SetEnv rate-limit 400 
    SetEnv rate-initial-burst 512
</Location>
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “Web Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password