nginx 1.8

server {

  listen 80;

  server_name test4.mp.com;

  root /home/mk/www/test4;

  index index.php index.html;

  location / {

    try_files $uri $uri/ /index.php$uri?$args;

  }

  location ~ \.php {

    fastcgi_pass unix:/tmp/php-fcgi.sock;

    include fastcgi.conf;

    fastcgi_index index.php;

    fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;

    fastcgi_param  PATH_INFO        $fastcgi_path_info;

    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

  }

}

相关推荐