Take the 2-minute tour ×

I have a script that is being access via a URL like this:


I need nginx to handle this specific route and send it to PHP. Right now my config currently just catches anything ending in .php and sends it to PHP. How can I tweak my config to handle the case above as well?

Here is my nginx block:

# Pass the PHP scripts to FastCGI server listening on
location ~ \.php$ {
    try_files $uri =404;

    # With php5-cgi alone:
    # With php5-fpm:
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    include fastcgi_params;
share|improve this question
add comment

1 Answer

Your fastcgi_split_pathinfo will not do anything, cause the location does not contain a slash and is anchored at the match end. Use a location like this:

 location ~ \.php/ {
     fastcgi_split_pathinfo ^(.*\.php)(/.*)$;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
share|improve this answer
add comment

Your Answer


