try_files rewrite drops other get variables

Edho Arief edho at
Thu Oct 18 02:03:00 UTC 2012

On Thu, Oct 18, 2012 at 8:59 AM, Edho Arief <edho at> wrote:
> On Thu, Oct 18, 2012 at 8:55 AM, Ian Evans <ianevans at> wrote:
>> I thought adding $args to the end of the try_files line would work but that
>> appeared to mess it up more. Is there any way to get the try_files version
>> to work like the old version?
>> Been staring at this but I don't see how
>> rewrite ^/galleries(/.*$|$) /galleries.php?mypath=$1 last; passes the path
>> and additional GET variables, but the try_files version doesn't pass on the
>> additional variables.
> From
> "If a replacement string includes the new request arguments, the
> previous request arguments are appended after them. If this is
> undesired, putting a question mark at the end of a replacement string
> avoids having them appended, for example:"

Additionally, I do indeed add $args for my try_files for wordpress:

try_files $uri $uri/ /index.php?q=$uri&$args;

More information about the nginx mailing list