make php work, i hate it here

This commit is contained in:
Bun 2025-07-10 01:47:01 -04:00
parent 2c90c2dcc0
commit b8db76b404
5 changed files with 38 additions and 24 deletions

View file

@ -24,6 +24,7 @@
servers = {
johnside.enable = true;
skyblock.enable = true;
uberbeta.enable = true;
velocity.enable = true;
};
};

View file

@ -1,7 +1,8 @@
{ config, lib, ... }:
{ config, lib, pkgs, ... }:
{
services.nginx.virtualHosts = {
"nixfox.ca" = {
services = {
# The main nginx domain
nginx.virtualHosts."nixfox.ca" = {
enableACME = true;
addSSL = true;
@ -12,6 +13,11 @@
error_page 404 /404.html;
'';
"~ \\.php$".extraConfig = ''
fastcgi_index index.php;
fastcgi_pass unix:${config.services.phpfpm.pools.nginx.socket};
'';
"/.well-known/matrix/client".extraConfig = ''
default_type application/json;
return 200 '{
@ -26,5 +32,22 @@
'';
};
};
# Enable PHP for some fancy stuff
phpfpm.pools.nginx = {
user = "nobody";
settings = {
"pm" = "dynamic";
"pm.max_children" = 75;
"pm.start_servers" = 10;
"pm.min_spare_servers" = 5;
"pm.max_spare_servers" = 20;
"pm.max_requests" = 500;
"listen.owner" = config.services.nginx.user;
"listen.group" = config.services.nginx.group;
"listen.mode" = "0660";
"catch_workers_output" = 1;
};
};
};
}