阿里云多个二级域名,解析到同一个机器外网ip地址:
http://demo.xxx.com.cn/
http://yang.xxx.com.cn/
nginx.conf 配置文件:
server
{
listen 80;
server_name yang.xxx.com.cn;# 第1个二级域名映射80端口
index index.html index.htm index.php;
root /www/server/phpmyadmin-yang;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /www/wwwlogs/access.log;
}
server
{
listen 80;
server_name demo.xxx.com.cn;# 第2个二级域名映射80端口
index index.html index.htm index.php;
root /www/server/phpmyadmin-demo;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
access_log /www/wwwlogs/access.log;
}