Rewrite

Maxim Dounin mdounin at mdounin.ru
Mon Nov 30 01:04:09 MSK 2009


Hello!

On Sun, Nov 29, 2009 at 03:53:49PM -0500, thinkbot wrote:

> Thank you Igor !!!
> 
> One more thing, is there a way to put there regular expressions, something like
> 
> location = /rss.xml {
> if ($args ~ ^type=popular&cid=([0-9]+) {
> rewrite ^ /cache/rss/popular_$1.xml break;
> }
> }

    location = /rss.xml {
        if ($args ~ "^type=popular&cid=([0-9]+)") {
            set $cid $1;
            rewrite ^ /cache/rss/popular_$cid.xml break;
        }
    }

Maxim Dounin




More information about the nginx mailing list