diff --git a/roles/services/frontend/templates/nginx-frontend.conf.j2 b/roles/services/frontend/templates/nginx-frontend.conf.j2 index 1cc4bf4..8b8d7e4 100644 --- a/roles/services/frontend/templates/nginx-frontend.conf.j2 +++ b/roles/services/frontend/templates/nginx-frontend.conf.j2 @@ -13,6 +13,8 @@ proxy_cache_path {{ frontend_cache_path }}/thumbnail levels=1:2 keys_zone=thumbn # Allow hole-punching in proxy with `?nocache=true`. proxy_cache_bypass $cookie_nocache $arg_nocache; +# TODO: Whitelist for load testing. +# https://gadelkareem.com/2012/03/25/limit-requests-per-ip-on-nginx-using-httplimitzonemodule-and-httplimitreqmodule-except-whitelist/ limit_req_zone $binary_remote_addr zone=search_reqs:10m rate=200r/s; limit_conn_zone $binary_remote_addr zone=search_conns:10m; @@ -37,7 +39,7 @@ server { } upstream search { - ip_hash; + # ip_hash; keepalive {{ groups['search_api'] | length * 2 }}; # 2 connections per backend server. {% for host in groups['search_api'] %} @@ -83,8 +85,8 @@ server { server_name {{ api_server_name }}; - limit_req zone=search_reqs burst=300; - limit_conn search_conns 200; # Concurrent requests per client IP. + # limit_req zone=search_reqs burst=300; + # limit_conn search_conns 200; # Concurrent requests per client IP. location / { return 301 https://app.swaggerhub.com/apis-docs/ipfs-search/ipfs-search;