This is a multi-part message in MIME format.
Am Mittwoch, 1. Dezember 2021, 13:34:52 CET schrieb Jan Kohnert:
[...]
location ~ \.php(/|$) {
include fastcgi_params;
fastcgi_split_path_info ^/simplesaml/(.+?\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
}
Merke: Immer die RegExp genau ansehen und testen. :-D Der RegExp hier matcht natürlich nur, wenn nach dem php ein / kommt, was nicht zwingend der Fall ist. Und
soweit ich es in der NGinX Doku gesehen habe, sollte das include doch erst nach den
Eigendefinitionen kommen
Jedenfalls funktioniert das:
location ~ \.php(/|$) {
# Strip out location base in the calculation of script name/parameters
fastcgi_split_path_info ^/simplesaml/(.+\.php)(.*)$;
# Check the script exists before proxying
if (!-f $document_root/$fastcgi_script_name) {
return 404;
}
# Mitigate
https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
# Now set the script name and proxy
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
# include Debians main configuration
include fastcgi_params;
}
--
Mit freundlichen Grüßen
Jan Kohnert
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body><p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Am Mittwoch, 1. Dezember 2021, 13:34:52 CET schrieb Jan Kohnert:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">[...]</p> <p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> location ~ \.php(/|$) {</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> include fastcgi_params;</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> fastcgi_split_path_info ^/simplesaml/(.+?\.php)(/.+)$;</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> fastcgi_param SCRIPT_FILENAME</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">> $document_root$fastcgi_script_name; fastcgi_pass</p>
<p style="margin-top:0;margin-bo