I am looking for a little advice here for a nginx noob. I have been reading that if statements are way slow in nginx so I was hoping for a little help in converting these. I have tried a bunch of different methods, all failures, so I thought I would toss up a question.
server_name *.noconformity.co noconformity.co;
# remove all sub domains and www
if ($http_host !~* "^(ftp|ssh)\.noconformity\.co$"){
set $rule_0 1$rule_0;
}
if ($http_host ~ "^([^.]+)\.noconformity\.co$"){
set $rule_0 2$rule_0;
}
if ($rule_0 = "21"){
rewrite ^/(.*)$ http://noconformity.co/$1 permanent;
break;
}
# Login Short Cut
if ($uri ~* "/login") {
rewrite ^/login(/.*)? /wp-admin$1;
}