server {
listen 80 default_server;
server_name test.example.com;
root F:/web;
access_log logs/access.log main buffer=1024k;
}
Nginx 设置三个域名在同一目录下:
server {
listen 80 ;
server_name http://a.com http://b.com http://c.com ;
location / {
root /home/website ;
if ($host = "http://a.com"){
set $index index.html ;
}
if ($host = "http://b.com"){
set $index index.php ;
}
if ($host = "http://c.com"){
set $index default.php ;
}
index $index ;
}
}