Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to set up a caching reverse proxy with 2 conditions; if either is met, it shouldn't be storing the file from origin:

  • partial-content request
  • request with query string

As configured below, I got nginx to NOT store partial-content requests.
However, it is still storing requests with query string. What am I missing here?

curl -r 1000-2000 [OK. No file stored.]
wget [Not OK. abcdef.dat stored on edge.]

location /data/ {
    set $originuri /origin$uri$is_args$args;
    errorpage 404 = $originuri;

location /origin/ {
    proxy_store /mnt1/edge/store;
    proxy_temp_path /mnt1/edge/tmp;
    proxy_set_header If-Range $http_if_range;
    proxy_set_header Range $http_range;
    proxy_no_cache $http_range $http_if_range $is_args;
share|improve this question

If I'm reading your configuration right, when you pass the request to the origin location for proxying, you're building a URI string which doesn't include a GET query string (i.e. you're flattening the $args). If that's what's happening, it would explain why the origin location isn't seeing $is_args as true.

This is a hunch on my part - I'd want to look at the request logs to see if it's correct.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.