It’s surprising how much incorrect informations are available on web for this topic. I was struggling to get correct configuration for simpleSAMLphp package (on Ubuntu 14.04). This is finally correct config (inside server section):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
rewrite ^(/simplesaml/?)(.*) /saml/www/$2 break; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } |
Key insight is to set additionally two CGI parameters SCRIPT_FILENAME and PATH_INFO, but after include fastcgi_params
(this configuration also sets SCRIPT_FILENAME).
Also I had to change php.ini:
1 2 |
cgi.fix_pathinfo=0 |