您的位置:首页 > 运维架构 > Nginx

thinkphp在nginx环境下URL模式为1时配置文件

2013-10-30 14:53 274 查看
server{
listen 80;
server_name yyy.xxx.com;

index  index.html index.htm index.php;
root /data/www/xxx.com/yyy.xxx.com;
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 405;
}

location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ .*\.(php|php5)?$ {
set $script     $uri;
set $path_info  "";
if ($uri ~ "^(.+?\.php)(/.+)$") {
set $script     $1;
set $path_info  $2;
}
fastcgi_pass unix:/tmp/nginx.socket;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_param  SCRIPT_FILENAME    $document_root$script;
fastcgi_param  SCRIPT_NAME        $script;
fastcgi_param  PATH_INFO          $path_info;
}

access_log /data/logs/nginx/yyy.xxx.com_access.log main;
error_log /data/logs/nginx/yyy.xxx.com_error.log;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: