I’m trying to migrate our server from Lighttpd. Everything has been
going smoothly until I have this problem with regular expression. I
suspect this is a bug with NGINX regular expression. Consider the
following RE:
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:
On Tue, Jun 24, 2008 at 05:47:32PM +0200, Peter Hoang wrote:
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:
As can be seen, Apache doesn’t decode $args while NGINX does. Is it
possible to orverwrite this behaviour? How much code needed to be
changed? I wouldn’t mind hacking the source if it’s a simple change.
I have a search form on the site and sometimes people do searches for
“C++”. When they submit the form, the URL will be http://localhost/search?q=C%2B%2B because the browser will encode the
term “C++”. Since we want to make it search engine friendly, we redirect
user to http://localhost/search/q-C%2B%2B.html, hence my question.
Any suggestion?
Cheers,
Cuong
Igor S. wrote:
On Tue, Jun 24, 2008 at 06:03:51PM +0200, Peter Hoang wrote:
Actually, I realise that Apache has NE (no encoding) flag for
RewriteRule and that’s why “C%2B%2B” is passed down intact to the
backend server. I’m thinking about implementing this flag in NGINX:
rewrite ^/search /search/q-$q.html last ne;
or
rewrite ^/search /search/q-$q.html ne;
I’m digging into the source code right now. However, it might be better
if someone could quickly show me the right direction to achieve that.
I could do check for ngx_strcmp(value[4].data, “ne”) == 0 in
ngx_http_rewrite and store the flag somewhere. My question is, how do we
store this flag so that we can retrieve it in 3 above functions? Can I
just create an additional flag in ngx_http_script_engine_t to do this?
As for the redirect decoding, what is the effect of commenting the
following line in ngx_http_script.c: