nginx下thinkphp配置文件

阅读更多
server {
     listen  80 ;
     listen [::]:80; 
     server_name localhost 
     root  document_root;
     fastcgi_intercept_errors on;

     location / {
       index index.php index.html index.htm;
       if ( !-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
            break;
        }
     }

     location ~ \.php/?.*$ {
	include /etc/nginx/fastcgi_params;
	set $path_info "";
	set $real_script_name $fastcgi_script_name;
              if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
	              set $real_script_name $1;
		set $path_info $2;
         }

         fastcgi_pass 127.0.0.1:9000;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_NAME $real_script_name;
         fastcgi_param SCRIPT_FILENAME document_root/$real_script_name;
         fastcgi_param PATH_INFO $path_info;
     } 

     location ~ /\.ht {
         #deny  all;
     }
}

 

你可能感兴趣的:(thinkphp,nginx)