Welcome! Log In Create A New Profile

Advanced

variables in "include"

Kaspars Dambis
July 20, 2009 06:40AM
I am trying to create a flexible virtual host environment, where each
host could have their own config.nginx file.

In sites-available/default I have:

server {
listen 80 default;
server_name _;
server_name_in_redirect off;

set $vhost_path /var/www/vhosts;

root $vhost_path/$host;
index index.php index.html index.htm;

# THE IMPORTANT BIT: vhost specific config files, for rewrites,
etc.
include /var/www/vhosts/$host/config.nginx;

[...]
}


'root' directive works fine, but the 'include' doesn't like the $host
variable in it.

I would like to avoid using server { ... } for each of the individual
hosts, in order to have global php settings.

What would be the best way to approach this?

Any pointers and suggestions are very welcome.

Regards,
Kaspars

p.s. using nginx 0.6.32-3 on debian lenny.
Subject Author Posted

variables in "include"

Kaspars Dambis July 20, 2009 06:40AM

Re: variables in "include"

Marcus Clyne July 20, 2009 08:56AM

Re: variables in "include"

Kaspars July 20, 2009 03:24PM

Re: variables in "include"

Marcus Clyne July 20, 2009 03:54PM

Re: variables in "include"

mike July 20, 2009 04:52PM

Re: variables in "include"

Kaspars July 20, 2009 05:25PM

Re: variables in "include"

mike July 20, 2009 05:52PM

Re: variables in "include"

Kaspars July 20, 2009 06:22PM

Re: variables in "include"

mike July 20, 2009 06:29PM

Re: variables in "include"

Kaspars July 20, 2009 06:48PM

Re: variables in "include"

Kaspars July 20, 2009 06:54PM

Re: variables in "include"

mike July 20, 2009 07:01PM

Re: variables in "include"

Marcus Clyne July 20, 2009 06:13PM

Re: variables in "include"

mike July 20, 2009 06:25PM

Re: variables in "include"

mike July 20, 2009 08:01PM

Re: variables in "include"

Marcus Clyne July 20, 2009 09:10PM

Re: variables in "include"

Marcus Clyne July 20, 2009 07:52PM

Re: variables in "include"

Kaspars July 20, 2009 06:45PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 148
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