From ebefd81defa0dfd229538fa2c1f9dd2d3b19536b Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sat, 20 Apr 2024 04:55:47 +0100 Subject: [PATCH] fix: split out the php config so it can serve php and html together --- applications/skynet_users.nix | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/applications/skynet_users.nix b/applications/skynet_users.nix index 4620171..ac9112f 100644 --- a/applications/skynet_users.nix +++ b/applications/skynet_users.nix @@ -108,16 +108,27 @@ in { # chmod 711 ~ # chmod -R 755 ~/public_html - locations."/" = { - alias = "/home/$user/public_html/"; - index = "index.html index.php"; - extraConfig = '' - autoindex on; - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass unix:${config.services.phpfpm.pools.${php_pool}.socket}; - include ${pkgs.nginx}/conf/fastcgi.conf; - ''; - tryFiles = "$uri$args $uri$args/ /index.html /index.php"; + locations = { + "/" = { + alias = "/home/$user/public_html/"; + index = "index.html"; + extraConfig = '' + autoindex on; + ''; + tryFiles = "$uri$args $uri$args/ /index.html"; + }; + + "~ ^(.+\\.php)(.*)$" = { + root = "/home/$user/public_html/"; + index = "index.php"; + extraConfig = '' + autoindex on; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:${config.services.phpfpm.pools.${php_pool}.socket}; + include ${pkgs.nginx}/conf/fastcgi.conf; + ''; + tryFiles = "$uri$args $uri$args/ /index.php"; + }; }; }; };