I have a setup as follows:
Linux Server (OpenVZ) with internal IP 10.10.0.4 - Container (10.10.0.5) - Container (10.10.0.6)
Due to limited IP space I only have one public IP mapped to the main server .4 so
192.168.1.2 => 10.10.0.4 on the network side.
Now on the main host the .4 I have apache running accepting connections on port 80, etc. With mod_proxy to have virtual hosts like such:
<VirtualHost 10.10.0.4:80 192.168.1.2> ServerAdmin email@example.com ServerName host.example.com ServerAlias ct1.host.example.com ProxyPass / http://10.10.0.5/ ProxyPassReverse / http://10.10.0.5/ </VirtualHost>
And there is wild card DNS setup so that *.host.example.com maps to 192.168.1.2. On the container a standard vhost like so is setup:
<VirtualHost 10.10.0.5:80 *:80> ServerName ct1.host.example.com ServerAlias ct1.host.example.com ServerAdmin firstname.lastname@example.org DocumentRoot /var/www <Directory /var/www/> Options FollowSymLinks AllowOverride All </Directory> Options Indexes FollowSymLinks ErrorLog /var/logs/error_log CustomLog /var/logs/access_log common </VirtualHost>
This works fine - however all sites like Joomla, etc that use some backwards way of finding the server name report 10.10.0.5 instead of ct1.host.example.com which I would need as this needs to work outside of the local network. Sure I can hack away at the code for each one of these deployments but that's not fixing the problem that's just applying a band-aid. I'm at a loss for why this is reporting the containers local ip instead of the hostname.
I have also tried the following setup:
/etc/hosts (on .4)
Then the following in the vHost:
ProxyPass / http://ct1.host.example.com ProxyPassReverse / http://ct1.host.example.com
However that does not yield anything different. Is there anything further I need to setup on the container - maybe some DNS, or actually create internal DNS for these IPs?