在nginx的http模块下面,一个server就可以看做一个站点,配置形式大概是这样的:
http {
index index.php index.htm index.html;
server {
server_name www.site1.com;
location / {
# [...]
}
}
server {
server_name site2.com;
location / {
# [...]
}
location /foo {
# [...]
}
}
}
Try