Multisite Nginx reverse proxy routing to Apache

Solution 1:

I run several domains on one nginx.conf file. Try this:

server {
    listen xxx.xxx.xxx.xxx:8090;
    server_name example.org;
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    location / {
        proxy_pass http://127.0.0.1:8090;
    }
}

server {
    listen xxx.xxx.xxx.xxx:8090;
    server_name example.com;
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    location / {
        proxy_pass http://127.0.0.1:8090;
    }
}

then add have two virtual configs in your apache

<VirtualHost *:8090>
ServerName example.org
ServerAdmin webmaster@localhost

DocumentRoot /var/cache/munin/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
</VirtualHost>

<VirtualHost *:8090>
ServerName example.com
ServerAdmin webmaster@localhost

DocumentRoot /var/cache/munin/www2
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
</VirtualHost>