Welcome! Log In Create A New Profile

Advanced

map module - mass hosting

April 23, 2014 08:07AM
Hello all,

I'd like to use map module for my vhost configuration to setup user name in root or fastcgi_pass parameter.

At this point i've 300 domains configured and my config look like this:

http
{
server {
..........
root /home/someuser;

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/www/someuser/fpm.socket;

include fastcgi_params.conf;
}

............
}

}


I'd like to replace this model by using map module like this


http
{

#map with about 300 domains

map $http_host $username {
example.com someuser;
escample2.com someuser2;
.......

}

server {
..........
root /home/$username;

include fastcgi.conf;

............
}

}


fastcgi.conf:

location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/www/$username/fpm.socket;

include fastcgi.conf;
}


My question is - Is this a good idea to use map like this ? Every request needs to find out username by $http_host searching through few hundreds of domains. Maybe i'm wrong but it can slow down request processing significantly.
Any suggestions ?
SubjectAuthorPosted

map module - mass hosting

beatnutApril 23, 2014 08:07AM

Re: map module - mass hosting

Maxim DouninApril 23, 2014 08:46AM

Re: map module - mass hosting

beatnutApril 23, 2014 09:27AM

Re: map module - mass hosting

Maxim DouninApril 23, 2014 10:36AM

Re: map module - mass hosting

beatnutApril 24, 2014 02:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready