I have nginx as a LB. And the 2 Apaches as the web servers. Lets say i got different domains:
- www.example.com
- checkout.example.com
Both domains will be in same 2 Apache Servers. But ofcoz under the different directories. And with the different VHost
files on the Apache vhost file.
As something like below design:
Nginx
|
-------------
| |
Apache Apache
Below is my current existing Nginx .conf file which is not working for the second Domain (checkout.example.com).
From NGINX (mysites.conf):
upstream serverpool {
server 1.2.3.101:80 weight=1;
server 1.2.3.102:80 weight=1;
}
server {
listen 80;
server_name www.example.com checkout.example.com;
location / {
proxy_pass http://serverpool;
}
}
From both of 2 Apache Servers' same Vhost Files (httpd.conf):
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /var/www/html/www.example.com/
</VirtualHost>
<VirtualHost *:80>
ServerName checkout.example.com
DocumentRoot /var/www/html/checkout.example.com/
</VirtualHost>
But whenever i browse that (http://checkout.example.com), the Domain still comes up in browser .. but with the contents of (www.example.com), which is totally wrong.
What did i do wrong please?