Welcome! Log In Create A New Profile

Advanced

variables in "include" for vhost specific config files

Kaspars
July 19, 2009 01:45PM
Privet Igor and dear list members,

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" for vhost specific config files

Kaspars July 19, 2009 01:45PM

Re: variables in "include" for vhost specific config files

Igor Sysoev July 21, 2009 05:05AM

Re: variables in "include" for vhost specific config files

mike July 21, 2009 12:57PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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