server {
listen 80; #监听的端口号
server_name websuitA.com; #域名
#access_log logs/host.access.log main;
location / {
root X:/wnmp/www/websuitA; #站点的路径
index default.php index.php index.html index.htm;
#站点的rewrite在这里写
rewrite ^/(w+).html$ /$1.php;
rewrite ^/(w+)/(w+)$ /$1/$2.php;
}
#错误页的配置
error_page 404 /error.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
root X:/wnmp/www/websuitA;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.ht {
deny all;
}
}
这样就做好了,站点A的配置,同样的方法,做websuitB的配置,这里我命名为vhosts_modoupi_websuitB.conf,直接上代码
server {
listen 80; #监听的端口号
server_name websuitB.com; #域名
#access_log logs/host.access.log main;
location / {
root X:/wnmp/www/websuitB; #站点的路径
index default.php index.php index.html index.htm;
#站点的rewrite在这里写
rewrite ^/(w+).html$ /$1.php;
rewrite ^/(w+)/(w+)$ /$1/$2.php;
}
#错误页的配置
error_page 404 /error.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ .php$ {
root X:/wnmp/www/websuitB;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.ht {
deny all;
}
}
这样,两个站点的配置就OK了。
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。