Load Balancing
Load Balancing is used when you have multiple Back-end servers and fewer vDDoS Server on the Front-end:
Declare the Back-end name:
Assuming you have:
http
and https
).So we will declare the back-end server as follows: (in the load-balancing.conf
file)
nano /vddos/conf.d/load-balancing.conf # Example create a backend name "backend1-nonssl" for "website.conf" from 3 server: upstream backend1-nonssl { least_conn; ip_hash; server 204.79.197.200:80 max_fails=3 fail_timeout=5s; server 107.154.75.41:80 max_fails=3 fail_timeout=5s; server 104.20.44.114:80 max_fails=3 fail_timeout=5s; } # Example create a backend name "backend1-ssl" for "website.conf" from 3 server: upstream backend1-ssl { least_conn; hash $remote_addr$http_user_agent; server 204.79.197.200:443 max_fails=3 fail_timeout=5s; server 107.154.75.41:443 max_fails=3 fail_timeout=5s; server 104.20.44.114:443 max_fails=3 fail_timeout=5s; }
backend1-nonssl
for the back-end group running the HTTP protocolbackend1-ssl
for the back-end group running the HTTPS protocolUse the Back-end name:
Replace that backend-name for the backend in the website.conf
file:
nano /vddos/conf.d/website.conf # Website Listen Backend Cache Security SSL-Prikey SSL-CRTkey your-domain.com http://0.0.0.0:80 http://backend1-nonssl no no no no your-domain.com https://0.0.0.0:443 https://backend1-ssl no no /vddos/ssl/your-domain.com.pri /vddos/ssl/your-domain.com.crt
Restart vDDoS:
vddos restart
Check Load Balancing:
You can use the query tool from different IP addresses, different locations … to inspect the load balancing operation.