1
例如,我有一个域example.com,当用户注册时,web应用程序将创建子域。如何从通配符域中排除特定的子域(Nginx)
- foo.example.com将指向同一网站
- bar.example.com将指向同一网站
但我想创建一个测试环境,例如demo.example.com它将指向另一个项目。当用户注册时,就会产生
- foo.demo.example.com
- bar.demo.example.com
目前我有什么
| Name | Type | Value |
|----------------|-------|-----------------|
| example.com. | A | 123.123.123.123 |
| *.example.com. | CNAME | example.com. |
而我的nginx config
server {
listen 80;
root /var/www/example.com/public;
index index.html index.htm index.php;
server_name example.com *.example.com;
location/{
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
如何为测试环境创建1?