本帖最后由 kelove 于 2016-11-12 19:09 编辑 两个服务器都在内网,路由有一个公网IP,通过80端口映射到服务器A(192.168.0.2)
服务器A上APACHE配置为:
<VirtualHost *:80>
ServerName a.com
ProxyPass / http://192.168.0.3/
ProxyPassReverse / http://192.168.0.3/
</VirtualHost>
<VirtualHost *:80>
ServerName b.com
ProxyPass / http://192.168.0.3/
ProxyPassReverse / http://192.168.0.3/
</VirtualHost>
在服务器B(appnode-192.168.0.3)上配置nginx,监听80口和a.com,b.com两个域名server {
listen 192.168.0.3:80;
server_name a.com;
root /var/www/a.com;
index index.html index.htm index.php;
}
server {
listen 192.168.0.3:80;
server_name b.com;
root /var/www/b.com;
index index.html index.htm index.php;
}
结果两个域名访问都指向一个首页(两个站点的首页应该是不同的),不知道为什么?