restful的nginx配置方法
location /{ root /webserver/www/a.tk.com; index index.html index.htm index.php; if ( $document_uri ~ "/api/v1/(.*?)/(.*)/(.*)") { rewrite ^/api/v1/(.*)/(.*)/(.*)$ /index.php?moudle=interface&control=$1&method=$2&id=$3 last; } if ( $document_uri ~ "/api/v1/(.*)/(.*)") { rewrite ^/api/v1/(.*)/(.*)$ /index.php?moudle=interface&control=$1&method=$2 last; } }