drupal-with-nginx icon indicating copy to clipboard operation
drupal-with-nginx copied to clipboard

PHP-FPM Pools for Different Sites/Servers

Open 58bits opened this issue 11 years ago • 3 comments

Hello again António,

By including apps/drupal/drupal.conf (or the boost vesrion) the choice of PHP-FPM pool has already been set.

Is it possible to configure a site (virtual server) to use the same Drupal include file, but a different PHP-FPM pool name? Perhaps with a variable setting?

Thoughts?

Best,

Tony

58bits avatar Jun 20 '13 19:06 58bits

Or what about creating a map_upstream.conf file as follows?

map $http_host $fpm_pool { default phpfpm; mydomain1.com pool_1; mydomain2.com pool_2; mydomain3.com pool_3; }

and then wherever fastcgi_pass appears we use...

fastcgi_pass $fpm_pool;

... to tell fastcgi_pass which upstream server we would like to use, which in turn contrains the desired fpm pool connection information.

58bits avatar Jun 20 '13 20:06 58bits

I don't think that will work because upstream doesn't handle variables AFAIK. I would use two different locations that have different upstreams, yeah it's ugly, but it should work :(

perusio avatar Aug 05 '13 12:08 perusio

Hi,

I end up using the solution of 58bits.

I create the /etc/nginx/map_upstream.conf file and put on nginx.conf a include to that file. On all references for "fastcgi_pass phpcgi;" I replace with "fastcgi_pass $fpm_pool;"

Well, I loose load balancers but my main goal was put all sites on the same server having each one a own php-fpm pool.

So that solution works for me... Now more than 50 sites on the server have each one own pfp-fpm pool. (this way we can have APC on each drupal instalation).

Pedro-Miguel avatar Aug 23 '13 19:08 Pedro-Miguel