Rewriting using query args?

Marcin Kasperski Marcin.Kasperski at
Tue Nov 6 20:44:55 MSK 2007

Marcin Kasperski <Marcin.Kasperski at> writes:

> Is it possible to rewrite url using query args? I mean rewriting sth
> like
>       /get_file?
> to
>       /download/

I asked stupid question so I will answer it myself.

Sth like

        if ( $args ~ file=(.*)\.zip ) {
           set $file $1;
           rewrite ^/get_file /download/$1 redirect;

More information about the nginx mailing list