Keep a copy of long running web responses

This commit is contained in:
tcely authored and GitHub committed 2025-03-03 09:32:00 -05:00
1 parent c5e96d6a29
commit efbbc7a178
1 file changed
+13
+13
View File
@@ -50,6 +50,14 @@ http {
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Caching proxy requests
proxy_cache_lock on;
proxy_cache_use_stale updating;
# temporary files in shared memory
proxy_temp_path /dev/shm/nginx/tmp 1;
# change this to /config/cache/nginx for a persistent cache
proxy_cache_path /dev/shm/nginx/cache levels=1:2:2 keys_zone=gunicorn:4m inactive=48h max_size=256m min_free=16m;
# X-Forwarded-Host (pass-through, or set)
map $http_x_forwarded_host $x_forwarded_host {
default $http_x_forwarded_host;
@@ -110,9 +118,14 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_redirect off;
# this read timeout should be lower than gunicorn's timeout
proxy_read_timeout 89s;
proxy_connect_timeout 10s;
# cache long running web requests
proxy_cache gunicorn;
proxy_cache_lock_timeout 88s;
}
# File dwnload and streaming