about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2022-10-19 23:34:26 +0200
committerFelix Buehler <account@buehler.rocks>2022-10-19 23:34:26 +0200
commitfe9fb739a9fef3ffe5de6a935bcd19e710351c89 (patch)
tree602553f4010eea94cb71428b3b26f835be4484a8 /nixos
parentd2596f85323f5d9d9ad2def19aade693192ae0e4 (diff)
freshrss: fix greader-api
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-apps/freshrss.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/nixos/modules/services/web-apps/freshrss.nix b/nixos/modules/services/web-apps/freshrss.nix
index 68780a3fe9dd1..fe3b464ffc38d 100644
--- a/nixos/modules/services/web-apps/freshrss.nix
+++ b/nixos/modules/services/web-apps/freshrss.nix
@@ -155,9 +155,17 @@ in
         virtualHosts.${cfg.virtualHost} = {
           root = "${cfg.package}/p";
 
+          # php files handling
+          # this regex is mandatory because of the API
           locations."~ ^.+?\.php(/.*)?$".extraConfig = ''
             fastcgi_pass unix:${config.services.phpfpm.pools.${cfg.pool}.socket};
             fastcgi_split_path_info ^(.+\.php)(/.*)$;
+            # By default, the variable PATH_INFO is not set under PHP-FPM
+            # But FreshRSS API greader.php need it. If you have a “Bad Request” error, double check this var!
+            # NOTE: the separate $path_info variable is required. For more details, see:
+            # https://trac.nginx.org/nginx/ticket/321
+            set $path_info $fastcgi_path_info;
+            fastcgi_param PATH_INFO $path_info;
             include ${pkgs.nginx}/conf/fastcgi_params;
             include ${pkgs.nginx}/conf/fastcgi.conf;
           '';