APACHE泛解析和NGINX泛解析

很多时候需要用泛解析,主要可能存在多个域名,特别是B2B2C商城,现公布下使用方式

 

首先是比较多人用的APACHE泛解析:

<VirtualHost *:80>
DocumentRoot /web/mzdfwl_com/
ServerName www.mzdfwl.com
ServerAlias *.mzdfwl.com
</VirtualHost>
<Directory “/web/mzdfwl_com/”>
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>

 

然后是NGINX泛解析:

server {
listen 80;
server_name mzdfwl.com *.mzdfwl.com;
root /web/mzdfwl_com/;
location / {

index index.php;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /web/mzdfwl_com/$fastcgi_script_name;
include fastcgi_params;
}
}