fix: invoiceplane nginx config
This commit is contained in:
parent
64320ce414
commit
3661395dff
|
@ -45,6 +45,12 @@ in {
|
||||||
createLocally = false;
|
createLocally = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
SETUP_COMPLETED=true
|
||||||
|
DISABLE_SETUP=true
|
||||||
|
IP_URL=https://invoicing.b12f.io
|
||||||
|
'';
|
||||||
|
|
||||||
poolConfig = {
|
poolConfig = {
|
||||||
"pm" = "dynamic";
|
"pm" = "dynamic";
|
||||||
"pm.max_children" = 32;
|
"pm.max_children" = 32;
|
||||||
|
|
|
@ -363,20 +363,34 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts = mapAttrs' (hostName: cfg: (
|
virtualHosts = mapAttrs' (hostName: cfg: (
|
||||||
nameValuePair "${hostName}" {
|
nameValuePair "${hostName}" {
|
||||||
locations."/" = {
|
root = "${pkg hostName cfg}";
|
||||||
root = "${pkg hostName cfg}";
|
extraConfig = ''
|
||||||
extraConfig = ''
|
index index.php index.html index.htm;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools."invoiceplane-${hostName}".socket};
|
if (!-e $request_filename){
|
||||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
rewrite ^(.*)$ /index.php break;
|
||||||
include ${pkgs.nginx}/conf/fastcgi.conf;
|
}
|
||||||
|
'';
|
||||||
|
|
||||||
|
locations = {
|
||||||
|
"/setup".extraConfig = ''
|
||||||
|
rewrite ^(.*)$ http://${hostName}/ redirect;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
"~ .php$" = {
|
||||||
|
extraConfig = ''
|
||||||
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
fastcgi_pass unix:${config.services.phpfpm.pools."invoiceplane-${hostName}".socket};
|
||||||
|
include ${pkgs.nginx}/conf/fastcgi_params;
|
||||||
|
include ${pkgs.nginx}/conf/fastcgi.conf;
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)) eachSite;
|
)) eachSite;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue