Welcome! Log In Create A New Profile

Advanced

Re: Problems with some rewrite

August 24, 2010 08:52AM
Igor Sysoev Wrote:
-------------------------------------------------------
> You DO need the locations, but you DO NOT need the
> rewrites.

ok.

> Why do you use space in "([0-9] {2}" ?

Because space was used here: http://wiki.nginx.org/NginxHttpRewriteModule#rewrite

> Here is example for 2 numbers location:
>
> # 2 numbers
> location ~ ^/img/default/-?(\d{2})/.+\.(.+)$
> {
> alias
> /home/images/public/$1x/xxx/$1/default.$2;
> }

Hm, what is \d{2}? Is there any documentation? And:

[code]
nginx -t
2010/08/24 14:40:25 [emerg] 7386#0: pcre_compile() failed: missing ) in "^/img/default/-?(\d"
2010/08/24 14:40:25 [emerg] 7386#0: the configuration file /etc/nginx/nginx.conf test failed
[/code]

I put it into "...":

[code]
location ~ "^/img/default/-?(\d{2})/.+\.(.+)$"
[/code]

But then i see:

[code]
2010/08/24 14:48:34 [emerg] 7449#0: the "alias" directive may not be used inside location given by regular expression
2010/08/24 14:48:34 [emerg] 7449#0: the configuration file /etc/nginx/nginx.conf test failed
[/code]

Whats wrong now?

Thx in advance
Subject Author Posted

Problems with some rewrite

revirii August 24, 2010 03:15AM

Re: Problems with some rewrite

revirii August 24, 2010 04:45AM

Re: Problems with some rewrite

Igor Sysoev August 24, 2010 08:32AM

Re: Problems with some rewrite

revirii August 24, 2010 08:52AM

Re: Problems with some rewrite

revirii August 24, 2010 10:10AM

Re: Problems with some rewrite

Igor Sysoev August 24, 2010 06:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
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