Nginx

  1. server {
  2. listen 80;
  3. server_name app.dev;
  4. root D:/newfm/;
  5. index index.php index.html;
  6. location / {
  7. try_files $uri $uri/ /index.php?r=$uri&$args;
  8. }
  9. location ~ .php$ {
  10. try_files $uri =404;
  11. include fastcgi.conf;
  12. fastcgi_pass 127.0.0.1:9000;
  13. }
  14. }
try_files $uri $uri/ /index.php?r=$uri&$args;规则中的?r= r是可配置的分隔符通过var_pathinfo=>'r'配置

原文: http://doc.cmlphp.com/devops/rewrite/nginx.html