Keep a copy of long running web responses
This commit is contained in:
1 parent
c5e96d6a29
commit
efbbc7a178
1 file changed
+13
@@ -50,6 +50,14 @@ http {
|
|||||||
gzip_http_version 1.1;
|
gzip_http_version 1.1;
|
||||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
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)
|
# X-Forwarded-Host (pass-through, or set)
|
||||||
map $http_x_forwarded_host $x_forwarded_host {
|
map $http_x_forwarded_host $x_forwarded_host {
|
||||||
default $http_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-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
|
|
||||||
# this read timeout should be lower than gunicorn's timeout
|
# this read timeout should be lower than gunicorn's timeout
|
||||||
proxy_read_timeout 89s;
|
proxy_read_timeout 89s;
|
||||||
proxy_connect_timeout 10s;
|
proxy_connect_timeout 10s;
|
||||||
|
|
||||||
|
# cache long running web requests
|
||||||
|
proxy_cache gunicorn;
|
||||||
|
proxy_cache_lock_timeout 88s;
|
||||||
}
|
}
|
||||||
|
|
||||||
# File dwnload and streaming
|
# File dwnload and streaming
|
||||||
|
|||||||
Reference in new issue
Block a user