Welcome! Log In Create A New Profile

Advanced

Re: Rewrite

November 29, 2009 05:42PM
I've made it like

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

and get error: pattern "^" has less captures than referrenced in substitution "/cache/rss/popular_$1.xml"

I guess its about rewrite ^, so where should I place ([0-9]+) to get the number ?
I've tested with rewrite ^cid=([0-9]+) but doesn't work

I'm still learning nginx, but it's great web server

Thank you !
Subject Author Posted

Rewrite

thinkbot November 29, 2009 01:21PM

Re: Rewrite

Igor Sysoev November 29, 2009 03:34PM

Re: Rewrite

thinkbot November 29, 2009 03:53PM

Re: Rewrite

thinkbot November 29, 2009 05:42PM

Re: Rewrite

thinkbot November 29, 2009 05:43PM

Re: Rewrite

thinkbot November 30, 2009 08:52AM

Re: Rewrite

Igor Sysoev November 29, 2009 04:04PM

Re: Rewrite

Maxim Dounin November 29, 2009 05:08PM

Re: Rewrite

Maxim Dounin January 11, 2017 08:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready