How to redirect to a query

sjark nginx-forum at
Wed Mar 9 13:50:33 MSK 2011

Thanks that works! one more question

can I do something like this if $host = '' and $arg_index
= "" then it should go to if it go to

Tryed to replayed AND with & or && but it just give me a error
"configuration file /etc/nginx/nginx.conf test failed"
and I am not allowed todo a if inside of a if
location = / {
      if ($host = '' AND $arg_index = "") {rewrite ^
?index=site&id=1 permanent;}
      if ($host = '' AND $arg_index = "") {rewrite ^
?index=site&id=2 permanent;}

Posted at Nginx Forum:,181278,181550#msg-181550

More information about the nginx mailing list