I have a Rails app (example1.com
) host on a Nginx server using the following configuration :
server {
access_log off;
passenger_enabled on;
client_max_body_size 5M;
listen 10.10.10.10:80;
server_name www.example1.com;
rails_env production;
root /var/www/production/example1/public;
location / {
root /var/www/production/example1/public;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
and everything works fine. However, now I have to install another app (example2.com
) using Apache. My problem is that Apache and Nginx are actually on the same machine, using the same IP (public
238.x.x.x
and private
10.x.x.x
) and the same port (80
). So everytime I'm trying to acces example2.com
, it's actually showing me example1.com
. Here is my Apache configuration:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName www.example2.com
DocumentRoot /var/www/production/example2
DirectoryIndex index.html
LogLevel Emerg
ErrorLog /var/log/api/example2.com_err
CustomLog /var/log/api/example2.com_cust Combined
<Directory /var/www/production/example2>
Options +ExecCGI
AllowOverride all
</Directory>
</VirtualHost>
I heard that using ProxyPass
may solve that issue but I lack of knowledge in that field and I need some assistance. Is there a way to do it?