Home > Nginx > Setup VirtualHost on Nginx
vim /etc/nginx/conf.d/virutal.conf
server {
	listen 80;
	server_name my-helper.com;
	rewrite ^/(.*) http://www.my-helper.com/$1 permanent;
}

server {
	listen 80;
	server_name www.my-helper.com;
	access_log /var/www/vhosts/my-helper.com/logs/access.log;
	error_log /var/www/vhosts/my-helper.com/logs/error.log;
	location / {
		root	/var/www/vhosts/my-helper.com/htdocs/;
		index	index.php;
	}
}

Reference:
http://articles.slicehost.com/2009/2/25/centos-nginx-virtual-hosts



Flag Counter