Welcome! Log In Create A New Profile

Advanced

include conf overwrite

Posted by mdhp 
include conf overwrite
August 11, 2011 12:02PM
I want to use simple virtual host configuration files, which include default .conf-Files.
Example:

File: vhost1
---------------
server {
include location.conf;

server_name www.myserver.org;
root /var/www/vhost1/;

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
}
}
---------------

File: location.conf
---------------
location ~ \.php$ {
include fastcgi_params;
# some optimization here

# Default if not overwritten in virtualhost
fastcgi_pass 127.0.0.1:9000;
}
---------------


location.conf have default configuration for all virtualhosts.
But on some vhosts i want to set other params (overwrite default). Is that possible?

Like in the example the vhost1 should have port 9001 not 9000.

Is it possible to include in vhost ?
Re: include conf overwrite
August 15, 2011 05:17AM
Is it only possible to include within a "location"-Block ?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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