使用Slim Framework进行Nginx配置,如何保留.php网址

Did*_*adi 1 php configuration nginx slim

我的服务器刚刚被提供程序清除,我没有Nginx配置文件的备份.我完全幸运地工作了,现在我不知道该怎么做.

所以我有多个文件来做一些特定的事情,我在每个文件上使用Slim Framework.我们的想法是将URL扩展保留在URL上.像这样的东西:

www.example.com/service.php/customer/1
www.example.com/api.php/data
www.example.com/test.php/other-data/5

有没有人对此有所了解?我真的忘记了之前的配置.

先感谢您

Did*_*adi 5

如果不知何故有人来到这里,我终于找到了答案.

server {
listen   80; ## listen for ipv4; this line is default and implied

root /usr/share/nginx/www;
index index.html index.htm;

# Make site accessible from http://localhost/
server_name localhost;

location / {
}

location /doc/ {
    alias /usr/share/doc/;
    autoindex on;
    allow 127.0.0.1;
    deny all;
}

location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
      return 404;
    }
    include fastcgi_params;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
}}
Run Code Online (Sandbox Code Playgroud)