码迷,mamicode.com
首页 > 其他好文 > 详细

fastcgi

时间:2015-10-22 09:13:39      阅读:287      评论:0      收藏:0      [点我收藏+]

标签:

fastcgi

fastcgi

fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/path/to/php-fpm.sock;

fastcgi_param

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;    一般只需要这个
include fastcgi_params;                                   其他的参数都写在这个文件中了
fastcgi_pass_header X-Forwarded-For   显示 header
fastcgi_hide_header X-Forwarded-For   隐藏 header
fastcgi_index index.php;

fastcgi_split_path_info
如果访问: http://localhost/index.php/Home/Index/index.html

location ~ \.php {
    fastcgi_split_path_info ^(.*\.php)(.*)$;
    # 经过上面的配置之后, $fastcgi_script_name 就会变成 /index.php, $fastcgi_path_info 就会变成 /Home/Index/index.html
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
}

另一种配置 path_info 方式

location ~ (.*\.php)(.*)$ {
    fastcgi_param SCRIPT_FILENAME $document_root$1;
    fastcgi_param PATH_INFO $2;
}

buffer

fastcgi_buffers 8 4k;            8 个 buffer, 每个 4k
fastcgi_buffer_size 4k;          默认和上面的一样
fastcgi_next_upstream    error | timeout | invalid_header | off

cache 控制

fastcgi

标签:

原文地址:http://www.cnblogs.com/sunznx/p/4899766.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!