location /screenshot/ {
if ($request_method != GET) {
proxy_pass http://127.0.0.1:8080;
break;
}
more_clear_headers 'Content-Type';
more_clear_headers 'Cache-Control';
more_set_headers 'Content-Type: image/jpeg';
more_set_headers 'Cache-Control: no-cache';
add_header Cache-Control no-cache;
add_header Content-Type image/jpeg;
default_type image/jpeg;
recursive_error_pages on;
proxy_pass http://screenshots;
proxy_cache_key $scheme$proxy_host$uri;
proxy_cache screenshots-cache;
proxy_cache_valid 200 302 1m;
proxy_cache_valid 404 1m;
proxy_ignore_headers X-Accel-Redirect;
proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
proxy_hide_header "Set-Cookie";
proxy_cache_lock on;
proxy_cache_lock_timeout 15s;
proxy_intercept_errors on;
proxy_connect_timeout 3s;
proxy_send_timeout 3s;
proxy_read_timeout 3s;
error_page 404 502 504 = @logo;
}
location @logo {
set $memcached_key "$uri/$tve_version";
memcached_pass memcached_cluster;
error_page 404 502 504 = @fallback;
}
location @fallback {
proxy_pass http://127.0.0.1:8080;
root /usr/share/nginx/html;
index index.html index.htm;
}