diff --git a/nginx.conf.sigil b/nginx.conf.sigil index 941b5652..7bdf37a4 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -13,6 +13,7 @@ map $http_origin $allow_origin { proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m max_size=1g inactive=60m use_temp_path=off; limit_conn_zone $binary_remote_addr zone=addr:10m; +limit_req_zone $binary_remote_addr zone=req_zone:10m rate=20r/s; {{ range $port_map := .PROXY_PORT_MAP | split " " }} {{ $port_map_list := $port_map | split ":" }} @@ -43,7 +44,7 @@ server { keepalive_timeout 70; keepalive_requests 500; proxy_read_timeout 3600; - limit_conn addr 1000; + limit_conn addr 10000; client_max_body_size 100M; {{ end }} @@ -61,7 +62,11 @@ server { proxy_cache_min_uses 2; proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; proxy_cache_background_update on; - proxy_cache_lock on; + proxy_cache_lock on; + + # Connections and request limits increase (bad for DDos) + limit_conn addr 10000; + limit_req zone=req_zone burst=10 nodelay; } # Custom location block for /upload