Thanks that works! one more question
can I do something like this if $host = 'one.mysite.com' and $arg_index = "" then it should go to one.mysite.com/?index=site&id=1 if two.mysite.com it go to two.mysite.com/?index=site&id=2
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
[code]
location = / {
if ($host = 'one.mysite.com' AND $arg_index = "") {rewrite ^ ?index=site&id=1 permanent;}
if ($host = 'two.mysite.com' AND $arg_index = "") {rewrite ^ ?index=site&id=2 permanent;}
}
[/code]