location / {
index index.php;
try_files $uri $uri/ /index.php?$args;
location ~ api$ {
try_files $uri $uri/ /api.php?$args;
}
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php5-service.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $2;
}