HAProxyconfiguration:
frontend https-proxy bind *:443 ssl crt /path/to/certs default_backend web backend web balance roundrobin option httpchk option forwardfor option httpclose server web-srv1 192.168.1.1:80 check inter 5000 server web-srv2 192.168.1.2:80 check inter 5000
Apache Conf:
<VirtualHost *:443> ServerName example.com DocumentRoot /var/www/example.com </VirtualHost> <VirtualHost *:443> ServerName test.example.com DocumentRoot /var/www/example.com </VirtualHost>
共享IP – 192.168.1.3
example.com转到192.168.1.3
test.example.com转到192.168.1.1
去test.example.com和绕过代理,虚拟主机工作得很好。
在example.com上查看代理,出于某种原因,它会转到conf文件中的默认实例。 (SSL.conf文件也包含在apache conf中)
不知道为什么会发生,也许这是一个Apacheconfiguration。
因为后端指向192.168.1.1:80和192.168.1.2:80,但是您的Apache vhostconfiguration为侦听端口443而不是端口80。