location style hostname matching?

Allen Parker parker at isohunt.com
Sun Feb 10 10:32:02 MSK 2008


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





More information about the nginx mailing list