Location style hostname matching?

If my configuration (sample) looks like this:

http {
server {
server_name _*;
root /path/to/htdocs/$host;
}}

is there a way to match ‘location’ or perhaps another type of keyword to
hostname for one particular vhost ie:

location a.host.net {
rewrite /blog(.+)$ /wordpress$1;
}
location b.host.net {
root /other/filepath/to/$host;
}

What I’m looking for is something similar to lighttpd’s $HTTP[‘host’].

Thanks,
Allen Parker

On Sat, Feb 09, 2008 at 11:32:02PM -0800, Allen Parker wrote:

location a.host.net {
rewrite /blog(.+)$ /wordpress$1;
}
location b.host.net {
root /other/filepath/to/$host;
}

What I’m looking for is something similar to lighttpd’s $HTTP[‘host’].

http {

 root    /path/to/htdocs/$host;

 server {
    server_name  _;  # default server
 }

 server {
    server_name  a.host.net;
rewrite /blog(.+)$ /wordpress$1;
 }

 server {
    server_name  b.host.net;
root  /other/filepath/to/b.host.net;
 }

}