标签:
文章转自:http://blog.itblood.com/nginx-same-ip-multi-domain-configuration.html
下面的是我本机的配置:
server { listen 80; server_name localhost; #绑定域名 index index.htm index.html index.php; #默认文件 root /data/webroot; #网站根目录 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } access_log /data/logs/access.log; error_log /data/logs/error.log; } server { listen 80; server_name test.localhost; #绑定域名 index index.htm index.html index.php; #默认文件 root /data/webroot/testRoot; #网站根目录 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } access_log /data/logs/test_access.log; error_log /data/logs/test_error.log; }
标签:
原文地址:http://www.cnblogs.com/wangkongming/p/4442345.html