Possible rewrite regular expression bug?

Peter Hoang lists at ruby-forum.com
Tue Jun 24 19:47:32 MSD 2008


Thanks guys. I have to say NGINX has a more active community than 
Lighttpd. Two more questions, is there something similar to 
AllowEncodedSlashes and how do I enable rewrite debug in NGINX? Without 
AllowEncodedSlashes, the following rewrite rule:

rewrite ^/([^\-]+)-([^/]*)\.html$ /j?$1=$2 last;

doesn't work with urls such as: 
http://localhost/q-test/jt-test1%2Ftest2.html (notice %2F which is the 
encoded value of '/').

Cheers,
Peter

Roxis wrote:
> On Monday 23 June 2008, Peter Hoang wrote:
>> I forgot to ask, how should I do the rewrite in NGINX?
> 
> if ($query_string ~ "&__Q=([^\-]+)-([^/]*)$") {
>     set $new_args "$1=$2";
>     rewrite / /j?$new_args last;
> }

-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list