duy13 / vDDoS-Protection

Welcome to vDDoS, a HTTP(S) DDoS Protection Reverse Proxy. Thank you for using!
https://vddos.voduy.com
483 stars 140 forks source link

TCP Proxy - Port Range #12

Closed daygle closed 6 years ago

daygle commented 6 years ago

Me gain...

I will be setting up proxy's for my TCP ports and was wondering if there was a way to specify a port range in the '/vddos/conf.d/tcp-udp-proxy.conf' file?

For example, if I wanted to open ports 3500,3501,3502,3503,3504 and 3505 (3500:3505) can I specify this? The only way I can think of doing this would be to setup the tcp-udp-proxy.conf like below.

Any suggestions would be much appreciated.

stream { server_traffic_status_zone; geoip_country /usr/share/GeoIP/GeoIP.dat; server_traffic_status_filter_by_set_key $geoip_country_code country::*; limit_conn_zone $binary_remote_addr zone=ip_addr:10m; # Limit perip

server {
    listen 0.0.0.0:3500;
    listen 0.0.0.0:3501;
    listen 0.0.0.0:3502;
    listen 0.0.0.0:3503;
    listen 0.0.0.0:3504;
    listen 0.0.0.0:3505;
    limit_conn ip_addr 1;       # Limit perip 1 (conn/s)
    proxy_download_rate 100k;   # Limit Download 100 (KB/s)
    proxy_upload_rate   100k;   # Limit Upload 100 (KB/s)
    proxy_pass 1.2.3.4.5:$server_port;      # Reverse proxy to backend_name
    server_traffic_status_filter_by_set_key $remote_addr ip_addr::$server_addr:$server_port;
}

}

duy13 commented 6 years ago

I think you have configured correctly, Remember that limit_conn ip_addr 1; # Limit perip 1 (conn/s) Too little, let's increase it if a client needs more connections to the service

daygle commented 6 years ago

Ok thanks, I'll have to enable and see how it goes.