Rewrite migration from apache.

Denis F. Latypoff denis at gostats.ru
Tue Feb 19 13:22:29 MSK 2008


Hello Matteo,

Tuesday, February 19, 2008, 3:37:36 PM, you wrote:

> Hi,

> I'm migrating some sites from apache 2.0 to nginx. I have problems with
> this rewrite:

> RewriteRule ^([^/]{2,})/$ home.php?key=$1

> I have changed to:

- rewrite ^([^/]{2,})/$ home.php?key=$1 last;
+ rewrite "^([^/]{2,})/$" home.php?key=$1 last;

> but when I make a checkconfig, nginx output this:

> directive "rewrite" is not terminated by ";" in /etc/nginx/nginx.conf:

> Seems that {2,} is not accepted from nginx. Can anybody explain me
> how can I solve this?

the problem is in "{}" characters which are used by nginx as config block:

location / { # <- begin block
} # <- end block

your config is: rewrite ^([^/]{ # <- begin block without proper terminating a
directive by ";".

> Thanks.



-- 
Best regards,
 Denis                            mailto:denis at gostats.ru






More information about the nginx mailing list