Want more timely Centmin Mod News Updates?
Become a Member

Limit user connections per ip from Nginx or Csf?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Oct 13, 2014.

  1. pamamolf

    pamamolf Well-Known Member

    3,073
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:22 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hi

    I am thinking to limit user connections on server per ip in case that someone run a siege benchmark on my server and maybe try to kill it (too many connections) or in general try to use many connections from a single ip but i am not sure which is the best way to do it ?

    Nginx level or Csf level?

    Nginx level will react faster as it will block or add it at wait stage but csf after a minute if the site is up :) will block the ip.....

    And what number to use for for a forum about?

    Thanks :)
     
  2. RoldanLT

    RoldanLT Well-Known Member

    4,157
    1,007
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,421
    Local Time:
    1:22 AM
    1.11
    10.2
  3. eva2000

    eva2000 Administrator Staff Member

    33,668
    7,456
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,461
    Local Time:
    3:22 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  4. pamamolf

    pamamolf Well-Known Member

    3,073
    293
    83
    May 31, 2014
    Ratings:
    +524
    Local Time:
    8:22 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    If i want to change the limit to 50 connections on :

    limit_conn limit_per_ip 50;

    do i have to change also this 16 value to 50?

    limit_conn_zone $binary_remote_addr zone=limit_per_ip:16m;
     
  5. eva2000

    eva2000 Administrator Staff Member

    33,668
    7,456
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +11,461
    Local Time:
    3:22 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 2
..