Welcome! Log In Create A New Profile

Advanced

Re: Create a single config for multiple Apache virtual hosts.

Francis Daly
September 01, 2015 02:20PM
On Wed, Aug 26, 2015 at 06:48:18AM -0400, YemSalat wrote:

Hi there,

> I am trying to run nginx as reverse proxy for Apache, running multiple
> virtual hosts (domains) on the same ip.
>
> I wanted to know if it is possible to have a single nginx config, that would
> pass the correct url/hostname/path to Apache, without having to create a
> separate server block for each domain.

If nginx is just reverse-proxying everything, then you
probably just want to send "Host:" using proxy_set_header
(http://nginx.org/r/proxy_set_header), but otherwise there is nothing
special to do.

> For example if all domain directories
> are the same as their hostnames:
> /var/www/mydomain.com/
> /var/www/anotherdomain.org/
> ...

Since nginx isn't touching the filesystem, it doesn't matter.

You'll have to decide what kind of logging you want -- possibly just
adding "$host" to each line in a single access.log will be enough.

> If it is - are there any potential issues with this setup?

For simple things, none spring to mind.

If you care about upstream (apache) knowing the client IP address,
you'll have to allow for that.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Create a single config for multiple Apache virtual hosts.

YemSalat August 26, 2015 06:48AM

Re: Create a single config for multiple Apache virtual hosts.

Francis Daly September 01, 2015 02:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready