location ~ "^/\d{12}/(.*)$" {
alias /var/www/vhost/$1;
location ~ "^/\d{12}/(.*)\.php$" {
fastcgi_pass backend;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include fastcgi_params;
try_files $fastcgi_script_name = 404;
}
}
при таком конфиге переменная $fastcgi_script_name будет иметь значение /876503948540/index.php
соответственно SCRIPT_FILENAME будет иметь значение /var/www/vhost/876503948540/index.php
и опять 404... можно сделать так:
location ~ "^/\d{12}/(.*)$" {
alias /var/www/vhost/$1;
location ~ "^/\d{12}/(.+\.php)$" {
fastcgi_pass backend;
fastcgi_param HTTPS on;
fastcgi_param SCRIPT_FILENAME $document_root$1;
fastcgi_index index.php;
include fastcgi_params;
try_files $1 = 404;
}
}
но как то это не красиво как мне кажется...