nginx安装
环境
PHP版本 (5.3.29)
nginx/1.4.4
MySQL版本:(5.5.18)
nginx需开启pathinfo
http://bbs.chshcms.com/show/6812.html 文中代码复制经测试会出错
下面是我配置成功代码
server {
listen 80;
server_name zhubo.ishuyin.com;
index index.html index.htm index.php;
root /alidata/www/zhubo;
location ~ .php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location / {
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 1h;
}
#伪静态规则
}
PHP版本 (5.3.29)
nginx/1.4.4
MySQL版本:(5.5.18)
nginx需开启pathinfo
http://bbs.chshcms.com/show/6812.html 文中代码复制经测试会出错
下面是我配置成功代码
server {
listen 80;
server_name zhubo.ishuyin.com;
index index.html index.htm index.php;
root /alidata/www/zhubo;
location ~ .php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location / {
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 1h;
}
#伪静态规则
}

回复列表(1)