I would like to change the html/php root for every user in a separate directory like:
abc12345 has its root-directory for html/php at: /home/abc12345/html/
This works already for non-php-files with following configuration:
location ^~ /abc12345 {
alias /home/abc12345/html;
index index.php;
location ~ \.php$ {
#include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_intercept_errors on;
fastcgi_param HTTPS on;
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
try_files $fastcgi_script_name =404;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
#try_files $uri =404;
}
}
As soon as I pass an php-file this does not work, cause the SCRIPT_FILENAME will try to search under /home/abc12345/html/abc12345/test.php
Even if I try
fastcgi_param SCRIPT_FILENAME $request_filename;
the directory would be /home/abc12345/html/abc12345/test.php
What is the correct configuration for fastcgi_param to escape the ../html/abc12345/..?