fpm-status & fpm-ping
This commit is contained in:
parent
db2d03893c
commit
c10bd3831a
2 changed files with 30 additions and 2 deletions
|
|
@ -129,8 +129,9 @@ RUN apt-get -qq update && \
|
|||
rm -R /conf && \
|
||||
sed -i "s/{{PHP}}/$PHP_VERSION/g" /etc/nginx/sites-enabled/default && \
|
||||
sed -i "s/{{PHP}}/$PHP_VERSION/g" /etc/service/php-fpm/run && \
|
||||
# Enable status panel
|
||||
sed -i -e "s|;pm.status_path|pm.status_path|g" /etc/php/*/fpm/pool.d/www.conf && \
|
||||
# Enable PHP-FPM status & PHP-FPM ping
|
||||
sed -i -e "s|;pm.status_path =.*|pm.status_path = /status|g" /etc/php/*/fpm/pool.d/www.conf && \
|
||||
sed -i -e "s|;ping.path =.*|ping.path = /ping|g" /etc/php/*/fpm/pool.d/www.conf && \
|
||||
# Using environment variables in config files works, it would seem. Neat!
|
||||
sed -i -e "s|pm.max_children = 5|pm.max_children = \${PHPFPM_MAX_CHILDREN}|g" /etc/php/*/fpm/pool.d/www.conf && \
|
||||
# Disable daemonising in nginx
|
||||
|
|
|
|||
|
|
@ -16,6 +16,33 @@ server {
|
|||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
# Pass thru status and ping requests to PHP-FPM
|
||||
location = /status {
|
||||
access_log off;
|
||||
allow 127.0.0.1;
|
||||
allow 10.0.0.0/8;
|
||||
allow 172.16.0.0/12;
|
||||
allow 192.168.0.0/16;
|
||||
deny all;
|
||||
fastcgi_pass unix:/run/php/php{{PHP}}-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location = /ping {
|
||||
access_log off;
|
||||
allow 127.0.0.1;
|
||||
allow 10.0.0.0/8;
|
||||
allow 172.16.0.0/12;
|
||||
allow 192.168.0.0/16;
|
||||
deny all;
|
||||
fastcgi_pass unix:/run/php/php{{PHP}}-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
# pass PHP scripts to PHP{{PHP}}-FPM server socket
|
||||
#
|
||||
location ~ \.php$ {
|
||||
|
|
|
|||
Loading…
Reference in a new issue