diff --git a/roles/float-infra-nginx/defaults/main.yml b/roles/float-infra-nginx/defaults/main.yml
index cba99a727bf4dbf753214980633d0195513a4e19..50b41600357ef0ecc4520c71601f908490a4705a 100644
--- a/roles/float-infra-nginx/defaults/main.yml
+++ b/roles/float-infra-nginx/defaults/main.yml
@@ -9,9 +9,6 @@ nginx_https_port: 443
 # How much memory to use for key caching in the proxy_cache.
 nginx_cache_keys_mem: "64m"
 
-# How much disk space to use for the cache.
-nginx_cache_fs_size: "1g"
-
 # URL of the SSO login server.
 sso_server_url: "https://login.{{ domain_public[0] }}/"
 
diff --git a/roles/float-infra-nginx/templates/config/conf.d/proxy.conf b/roles/float-infra-nginx/templates/config/conf.d/proxy.conf
index 0fbc839a2365b17024706f1cffc7c398ab7ce9e7..aa7d0497321d9a2b300f15a2353e2c86111aee3f 100644
--- a/roles/float-infra-nginx/templates/config/conf.d/proxy.conf
+++ b/roles/float-infra-nginx/templates/config/conf.d/proxy.conf
@@ -21,12 +21,11 @@ proxy_http_version      1.1;
 
 # Set up a global cache.
 include /etc/nginx/accept.map;
-proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=global:{{ nginx_cache_keys_mem }} max_size={{ nginx_cache_fs_size }} inactive=1d use_temp_path=off;
+proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=global:{{ nginx_cache_keys_mem }} {% for k, v in nginx_cache_params | combine(nginx_cache_custom_params | default({})) | dictsort %} {{ k }}={{ v }}{% endfor %};
 proxy_cache_key "$scheme$host$request_uri$http_accept_simplified$sent_http_content_language";
 proxy_no_cache $cookie_SSO $http_authorization;
 proxy_cache_methods GET HEAD;
 proxy_cache_valid 200 10m;
-proxy_cache_min_uses 2;
 
 # Show our own error pages, not the remote ones.
 proxy_intercept_errors on;
diff --git a/roles/float-infra-nginx/vars/main.yml b/roles/float-infra-nginx/vars/main.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b28532d2118c98cfd8973d58b8188c30e2386388
--- /dev/null
+++ b/roles/float-infra-nginx/vars/main.yml
@@ -0,0 +1,10 @@
+---
+
+nginx_cache_params:
+  # Use nginx_cache_fs_size for backwards compatibility.
+  max_size: "{{ nginx_cache_fs_size | default('1g') }}"
+  inactive: "1h"
+  use_temp_path: "off"
+  manager_files: 1000
+  loader_files: 1000
+