Skip to content

Instantly share code, notes, and snippets.

@caquino
Created May 3, 2013 01:26
Show Gist options
  • Save caquino/5506639 to your computer and use it in GitHub Desktop.
Save caquino/5506639 to your computer and use it in GitHub Desktop.
Do not cache 0-byte files on NGINX
map $upstream_http_content_length $flag_cache_empty {
default 0;
0 1;
}
server {
....
location / {
...
proxy_no_cache $flag_cache_empty;
proxy_cache_bypass $flag_cache_empty;
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment