summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-11-13 04:14:32 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-11-14 01:43:44 +0100
commitca6e14c385caff158ce8b937d7b8ce995eb2630e (patch)
tree266fe0d2e4007f16f131c3be989d3e7d9b82e569
parentAdd ldapadmin profile. (diff)
downloadprofiles-ca6e14c385caff158ce8b937d7b8ce995eb2630e.tar.gz
profiles-ca6e14c385caff158ce8b937d7b8ce995eb2630e.tar.xz
PHPLDAPADMIN add fastcgi-php for nginx.
-rw-r--r--manifests/phpldapadmin.pp23
1 files changed, 22 insertions, 1 deletions
diff --git a/manifests/phpldapadmin.pp b/manifests/phpldapadmin.pp
index 416ca19..55bfa33 100644
--- a/manifests/phpldapadmin.pp
+++ b/manifests/phpldapadmin.pp
@@ -9,11 +9,32 @@ class profiles::phpldapadmin (
auth_type => 'cookie',
}
+ # TODO do this better.
+ # Debian gives this file through nginx-common, but I can't find it
+ # for arch.
+ file { '/etc/nginx/snippets/fastcgi-php.conf':
+ content => @(EOF)
+ # regex to split $uri to $fastcgi_script_name and $fastcgi_path
+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+
+ # Check that the PHP script exists before passing it
+ try_files $fastcgi_script_name =404;
+
+ # Bypass the fact that try_files resets $fastcgi_path_info
+ # see: http://trac.nginx.org/nginx/ticket/321
+ set $path_info $fastcgi_path_info;
+ fastcgi_param PATH_INFO $path_info;
+
+ fastcgi_index index.php;
+ include fastcgi.conf;
+ | EOF
+ }
+
nginx::resource::location { 'phpldapadmin':
location => '~ \.php$',
server => $nginx_server,
fastcgi_params => 'snippets/fastcgi-php.conf',
- fastcgi => 'unix:/run/php/php-fpm.sock',
+ fastcgi => 'unix:/run/php-fpm7/php-fpm.sock',
ssl => true,
ssl_only => true,
www_root => '/usr/share/webapps/phpldapadmin',