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 ?
Subject Author Posted

map module - mass hosting

beatnut April 23, 2014 08:07AM

Re: map module - mass hosting

Maxim Dounin April 23, 2014 08:46AM

Re: map module - mass hosting

beatnut April 23, 2014 09:27AM

Re: map module - mass hosting

Maxim Dounin April 23, 2014 10:36AM

Re: map module - mass hosting

beatnut April 24, 2014 02:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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