Comments (3)
questo in realtà potrebbe confluire in #10
from spid-cie-php.
Rettifica, la configurazione nginx si simplesamlphp è più delicata di altre librerie PHP, ci sono due aspetti:
- Lo snippet di configurazione che si usa di solito in nginx su debian 9 (
snippets/fastcgi-php.conf
, vedi [1]) non va bene, perché è indispensabile cambiarefastcgi_split_path_info
, la regex che divide la url in$fastcgi_script_name
e$fastcgi_path_info
. Invece della regex predefinitafastcgi_split_path_info ^(.+\.php)(/.+)$;
bisogna usarefastcgi_split_path_info ^(.+?\.php)(/.+)$
. - Bisogna cambiare la regex che cattura le richieste a file con estensione php: invece della regex standard (
location ~ \.php$
) che è greedy, bisogna usare\.php(/|$)
.
Se non si attuano ambedue quese modifiche, l'url https://spid.simevo.com/myservice/module.php/saml/sp/metadata.php/service-l1?output=xml
che dovrebbe restituire i metadata, invece di matchare il file /srv/spid-php/www/myservice/module.php
va a matchare /srv/spid-php/www/myservice/module.php/saml/sp/metadata.php/service-l1
quindi dà un errore 404.
Lo snippet indicato in [2] da questo punto è fuorviante, mentre [3] è più corretto, ma non abbastanza corretto perché bisogna tenere conto che su debian 9 php è versione 7 invece che 5 e che lo snippet per configurare fastgci è fastcgi.conf (che definisce anche SCRIPT_FILENAME) invece di fastcgi_params.
Sezione server corretta:
server {
listen 443 ssl http2;
server_name spid.simevo.com;
root /srv/spid-php/www;
include snippets/snakeoil.conf;
location / {
try_files $uri $uri/ =404;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
}
location /myservice/ {
index index.php;
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.+)$;
try_files $fastcgi_script_name =404;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
}
# error_log /var/log/nginx/error_debug.log debug;
}
Riferimenti:
[1] http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info
[2] https://simplesamlphp.org/docs/development/simplesamlphp-install#section_7
[3] https://casadelkrogh.dk/2014/09/embedding-simplesamlphp-using-nginx/
from spid-cie-php.
Aggiornato README
from spid-cie-php.
Related Issues (20)
- fix: proxy config setup
- basicConstraints HOT 3
- CIE: Errori di convalida del metadata HOT 2
- php 8.2
- Undefined array key "idp" in /home/.../login-spid.php HOT 10
- LOGIN CIE - Errore "The request cannot be fulfilled because the message received does not meet the security requirements of the login service." HOT 2
- spid metadata: xmlns di spid:IPACode e spid:Public HOT 5
- Pubblicare spid-cie-php su Packagist
- Errore convalida aggregato da portale HOT 5
- CIE: tutte le richieste di autenticazione sono di livello 3, anche dopo aver impostato $level a 2
- AuthnRequest Signature validation
- Documentazione per Docker
- Reindirizzato su HTTPS con porta 80
- Versione OpenSSL a runtime
- Possibili BUG riscontrati in modalità proxy con solo CIE
- Configurazione dinamica dell'idp CIE
- Aggiungere supporto all'accesso con eIDAS
- Errore nel Demo SPID Validator --> Request --> Check Strict HOT 3
- Metadata generato con spid-cie-php non validabile HOT 1
- OrganizationName length
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spid-cie-php.