On Jan 28, Jan Kowalsky wrote:
I try to configure nginx_servers.
I have something like
nginx__servers:
- name: [ 'drupal7' ]
enabled: True
ssl: True
acme: True
type: 'php'
php_upstream: 'unix:/run/php7.0-fpm-www-data.sock'
in my inventory.
is there any possibility to refer to a default php pool for the
php_upstream variable? I saw that there is something in dependent roles,
like dokuwiki__nginx__dependent_servers - but I don't understand how to use.
Sure, the default 'www-data' PHP pool can be targeted by creating a nginx
upstream configuration. You can use this:
#v+
nginx__servers:
- name: [ 'drupal7' ]
enabled: True
ssl: True
acme: True
type: 'php'
php_upstream: 'php-drupal7'
nginx__upstreams:
- name: 'php-drupal7'
type: 'php'
php_pool: 'www-data'
#v-
This will result in /etc/nginx/sites-available/drupal7.conf file with:
#v+
server {
...
location php ... {
fastcgi_pass php-drupal7;
}
}
#v-
And the /etc/nginx/conf.d/upstream_php_drupal7.conf file with:
#v+
upstream php-drupal7 {
server unix:/run/php7.0-fpm-www-data.sock;
}
#v-
Then, the 'debops.php' role should create that socket by default and allow the
'www-data' user to use it.
Cheers,
Maciej