nginx“漂亮的url”

所以基本上我目前正在面临一个问题,让以下工作。

http://example.net/url.php/value1/value2/value3

我已经尝试了各种try_files的方法,但没有一个似乎在工作。 以上是我需要做的所有事情,但这是我想出的错误:

这是我当前configuration的副本。

server { listen 80; server_name example; error_log /var/log/nginx/error.log; index index.php; root /www/example.net; location / { try_files $uri $uri/ /index.php =404; } location ~* \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; } } 

我已经尝试了很多组合,我已经阅读了各种教程中的try_files在位置/和他们都没有以我想要的方式工作。 我得到了404(如果index.php不包括在最后,因为它没有find文件或目录)或500错误。

 2013/01/23 07:21:35 [error] 1411#0: *1 rewrite or internal redirection cycle while internally redirecting to "/testing_nginx.php/test", client: 75.182.96.115, server: subeta, request: "GET /testing_nginx.php/test HTTP/1.1", host: "166.78.101.192" 

您可以使用Nginx的URL重写。 通过实例可以添加到你的nginx.conf。

 location / { rewrite ^/pay/(.*)/(.*)$ /pay.php?p=$1&s=$2? last; rewrite ^/register$ /register.php? last; location ~ \.ph[pb]$ { #PHP FASTCGI SETTINGS } }