docker-compose up -d --build
Access nginx default page locally at http://localhost:8080
- Limiting number of connections from single IP address: added following config to nginx
default.conf
filelimit_conn_zone $binary_remote_addr zone=addr:10m; server { ... location / { limit_conn addr 10; ... } ... }
- Closing slow connections: added following config to nginx
default.conf
fileserver { ... client_body_timeout 5s; client_header_timeout 5s; ... }
- Increasing NGINX worker connections limit: added following config to nginx
nginx.conf
fileevents { worker_connections 100000; }
- Increasing user’s open file limit: added following config to nginx container in
docker-compose.yml
fileulimits: nofile: soft: "100000" hard: "100000"
- Increasing NGINX’s worker number of open files limit: added following config to nginx
nginx.conf
fileworker_rlimit_nofile 102400;
Slowloris implementation was forked from https://github.com/valyala/goloris and POST requests were replaced with GET in order to make requests to Nginx static page (Nginx forbids POST requests to static pages)