add haproxy fastcgi option
This commit is contained in:
parent
3136d02127
commit
0705ce1c47
1 changed files with 26 additions and 6 deletions
|
@ -3,18 +3,38 @@
|
|||
}:
|
||||
{ serviceName
|
||||
, serviceSocket
|
||||
, phpFastcgi ? false
|
||||
, phpDocroot ? null
|
||||
, phpIndex ? "index.php"
|
||||
}:
|
||||
|
||||
let
|
||||
backend =
|
||||
if !phpFastcgi
|
||||
then ''
|
||||
backend ${serviceName}
|
||||
mode http
|
||||
option forwardfor
|
||||
server ${serviceName}1 ${serviceSocket}
|
||||
'' else ''
|
||||
backend ${serviceName}
|
||||
mode http
|
||||
option forwardfor
|
||||
use-fcgi-app ${serviceName}-php-fpm
|
||||
server ${serviceName}1 ${serviceSocket} proto fcgi
|
||||
|
||||
fcgi-app ${serviceName}-php-fpm
|
||||
log-stderr global
|
||||
docroot ${phpDocroot}
|
||||
index ${phpIndex}
|
||||
path-info ^(/.+\.php)(/.*)?$
|
||||
'';
|
||||
in
|
||||
{
|
||||
acl = ''
|
||||
acl acl_${serviceName} hdr_beg(host) ${serviceName}.
|
||||
use_backend ${serviceName} if acl_${serviceName}
|
||||
'';
|
||||
|
||||
backend = ''
|
||||
backend ${serviceName}
|
||||
mode http
|
||||
option forwardfor
|
||||
server ${serviceName}1 ${serviceSocket}
|
||||
'';
|
||||
inherit backend;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue