Adding load-balancing on unix sockets

This commit is contained in:
VirtuBox
2019-03-20 02:12:13 +01:00
parent dca60b4226
commit 57bd6257db
8 changed files with 238 additions and 127 deletions

View File

@@ -0,0 +1,31 @@
# Stub status NGINX CONFIGURATION
# DO NOT MODIFY, ALL CHANGES WILL BE LOST AFTER AN WordOps (wo) UPDATE
{{#phpconf}}
upstream phpstatus {
server unix:/run/php/php7.2-fpm.sock;
}
{{/phpconf}}
server {
listen 127.0.0.1:80;
server_name 127.0.0.1 localhost;
access_log off;
log_not_found off;
root /var/www/html;
location ~ /(stub_status|nginx_status) {
stub_status on;
allow 127.0.0.1;
deny all;
access_log off;
log_not_found off;
}
{{#phpconf}}
location ~ /(status|ping) {
include fastcgi_params;
allow 127.0.0.1;
deny all;
fastcgi_pass phpstatus;
access_log off;
log_not_found off;
}
{{/phpconf}}
}

View File

@@ -30,7 +30,12 @@ server 127.0.0.1:{{debug7}};
# PHP 7.2 upstream with load-balancing on two unix sockets
upstream php72 {
least_conn;
server unix:/var/run/php/php72-fpm.sock;
server unix:/var/run/php/php72-two-fpm.sock;
keepalive 5;
}
# PHP 7.2 debug
@@ -63,4 +68,3 @@ upstream netdata {
server 127.0.0.1:19999;
keepalive 64;
}

View File

@@ -52,7 +52,7 @@ server {
{{^static}}include {{#basic}}common/php73.conf;{{/basic}}{{#wpfc}}common/wpfc-php73.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php73.conf;{{/wpsc}}{{#wpredis}}common/redis-php73.conf;{{/wpredis}}
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
{{#wp}}include common/wpcommon-php73.conf;{{/wp}}
include common/locations-php73.conf;
include common/locations-php73.conf;{{/proxy}}
include {{webroot}}/conf/nginx/*.conf;
{{/proxy}}
}

View File

@@ -52,7 +52,7 @@ server {
{{^static}}include {{#basic}}common/php72.conf;{{/basic}}{{#wpfc}}common/wpfc-php72.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php72.conf;{{/wpsc}}{{#wpredis}}common/redis-php72.conf;{{/wpredis}}
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
{{#wp}}include common/wpcommon-php72.conf;{{/wp}}
include common/locations-php72.conf;
include common/locations-php72.conf;{{/proxy}}
include {{webroot}}/conf/nginx/*.conf;
{{/proxy}}
}