try_files doesn't work after $args rewite?

"Brane F. Gračnar" brane.gracnar at tsmedia.si
Mon Dec 19 14:11:06 UTC 2011


Hello

Directive try_files doesn't work after rewriting $args:

location / {
  # remove auth key from query string
  if ($args ~ ^(.*)&?auth=[^&]+(.*)) {
    set $args "$1$2";
  }

  try_files $uri $uri/ @webapp;
}

location @webapp {
  # send request to upstream
  proxy_pass http://some_upstream;
}

Log:

2011/12/19 15:05:16 [error] 29913#0: *40 open()
"/var/www/sth/Rest.svc/event/5826710" failed (2: No such file or
directory), client: 172.16.16.81, server: epg.siol.tv, request: "GET
/sth/Rest.svc/event/5826710?auth=blahblahblah HTTP/1.1", host: "epg.siol.tv"

What am i doing wrong?

Best regards, Brane



More information about the nginx mailing list