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

How to protect against HTPP Flood?

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
13 posts
  • 1
  • 2
  • Next
RevengeFNF
Posts: 92
Joined: Sat Aug 02, 2014 6:50 pm

Os: CentOS 6x
Web: nginx + php-fpm
How to protect against HTPP Flood?
  • Quote

Post by RevengeFNF » Sun Apr 26, 2015 4:53 pm

Hello,

I have a VPS of 3 Cores and 4Gb of Ram with Centos 6.6 installed.
I have VestaCP running and the only thing i changed was changing Mysql 5.5 with MariaDB 10.

I have a Board installed there, Invision Power Board.

It runs fine with no problem at all, Vesta is really good ;)

But if someone press F5 for long time it will lead to the CPU raising to 100%. So anyone with a keyboard that have the F5 key, can almost take my site down.

Does anyone know how to limit the resquest per second for an IP? I have already installed Mod_Security and Mod_Evasive but i get the same result if i press F5 for a long time.

Regards.
Top

bestony
Posts: 17
Joined: Sat Mar 07, 2015 5:22 pm
Contact:
Contact bestony
Website

Re: How to protect against HTPP Flood?
  • Quote

Post by bestony » Sun Apr 26, 2015 7:42 pm

I think MayBe You Need This http://nginx.org/en/docs/http/ngx_http_ ... odule.html
Top

RevengeFNF
Posts: 92
Joined: Sat Aug 02, 2014 6:50 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: How to protect against HTPP Flood?
  • Quote

Post by RevengeFNF » Sun Apr 26, 2015 11:02 pm

Ok, so i add this in nginx.conf after the http{

Code: Select all

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
And then in myip.conf inside conf.d folder i add this after the location / {

Code: Select all

limit_req zone=one burst=5;
Then restarted nginx service.

Is this correct? I still have the issue.
Top

RevengeFNF
Posts: 92
Joined: Sat Aug 02, 2014 6:50 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: How to protect against HTPP Flood?
  • Quote

Post by RevengeFNF » Sun Apr 26, 2015 11:44 pm

Ok, i managed to work it.

I added the limit_req zone=one burst=5; instead to: /home/admin/conf/web/nginx.conf

Many Thanks. If i press F5 it will now lead to a 500 error page.
Top

skintekx
Posts: 4
Joined: Mon Apr 27, 2015 5:50 pm

Re: How to protect against HTPP Flood?
  • Quote

Post by skintekx » Mon Apr 27, 2015 6:01 pm

RevengeFNF wrote:Ok, i managed to work it.

I added the limit_req zone=one burst=5; instead to: /home/admin/conf/web/nginx.conf

Many Thanks. If i press F5 it will now lead to a 500 error page.
Can you give me your nginx.conf to solve my problem, my wordpress site is down after 1-2 seconds when someone press F5 i have 1 VPS with 1GB of ram.
Top

RevengeFNF
Posts: 92
Joined: Sat Aug 02, 2014 6:50 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: How to protect against HTPP Flood?
  • Quote

Post by RevengeFNF » Mon Apr 27, 2015 10:15 pm

skintekx wrote:
RevengeFNF wrote:Ok, i managed to work it.

I added the limit_req zone=one burst=5; instead to: /home/admin/conf/web/nginx.conf

Many Thanks. If i press F5 it will now lead to a 500 error page.
Can you give me your nginx.conf to solve my problem, my wordpress site is down after 1-2 seconds when someone press F5 i have 1 VPS with 1GB of ram.
I have reverted this solution. It works, blocking the HTTP Flood, but the site becomes very slow. I don't know why, but it happens.
Top

skintekx
Posts: 4
Joined: Mon Apr 27, 2015 5:50 pm

Re: How to protect against HTPP Flood?
  • Quote

Post by skintekx » Mon Apr 27, 2015 10:26 pm

i added this line limit_req zone=one burst=5 on /home/myuserforwordpressebsite/web/nginx.conf
and after restart:

Code: Select all

service nginx restart
nginx: [emerg] invalid number of arguments in "limit_req" directive in /home/myuserforwordpressebsite/conf/web/nginx.conf:33
nginx: configuration file /etc/nginx/nginx.conf test failed
Top

RevengeFNF
Posts: 92
Joined: Sat Aug 02, 2014 6:50 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: How to protect against HTPP Flood?
  • Quote

Post by RevengeFNF » Tue Apr 28, 2015 5:48 pm

You should add that to /home/admin/conf/web/nginx.conf
Top

skintekx
Posts: 4
Joined: Mon Apr 27, 2015 5:50 pm

Re: How to protect against HTPP Flood?
  • Quote

Post by skintekx » Tue Apr 28, 2015 6:15 pm

RevengeFNF wrote:You should add that to /home/admin/conf/web/nginx.conf
service nginx restart
nginx: [emerg] unexpected end of file, expecting ";" or "}" in /home/admin/conf/web/nginx.conf:36
nginx: configuration file /etc/nginx/nginx.conf test failed
[root@server ~]#
Top

RevengeFNF
Posts: 92
Joined: Sat Aug 02, 2014 6:50 pm

Os: CentOS 6x
Web: nginx + php-fpm
Re: How to protect against HTPP Flood?
  • Quote

Post by RevengeFNF » Tue Apr 28, 2015 9:50 pm

Post here your nginx.conf
Top


Post Reply
  • Print view

13 posts
  • 1
  • 2
  • Next

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