Tweaking $host value

Hi,

When a user enters www.mysite.com, the value returned by nginx in
$host is “www.mysite.com”,

If I use this in my root declaration such as:

root /var/www/$host;

This means that I must rename my folder on disk as www.mysite.com.

Is there a way so that $host, returns mysite.com only?

I’m feeling lucky: http://wiki.codemongers.com/NginxHttpRewriteModule

The page has an example that does exactly what I needed:
$host_without_www. And at the same time I understand better how the
variables work, how rewriting works and how to create new variables.