Nginx 配置中 fastcgi_index 起什么作用?
2015-06-01 22:30
309 查看
1,fastcgi_index 语法:fastcgi_index file
默认值:none
使用字段:http, server, location
如果URI以斜线结尾,文件名将追加到URI后面,这个值将存储在变量$fastcgi_script_name中。例如:
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;
请求"/page.php",参数SCRIPT_FILENAME将被设置为"/home/www/scripts/php/page.php",但是请求"/"则为"/home/www/scripts/php/index.php"。
2,
fastcgi_index:如果请求的FastCGI URI以/结束,该指令设置的文件会被附加到URI的后面并保存在变量$fastcgi_script_name中
index:该指令用于设置nginx的默认首页文件
而我们的配置经常是
location ~* \.php$ {
fastcgi_pass cos_ups;
fastcgi_index index.php;
include fastcgi.conf;
}
在这里指定fastcgi_index 其实是没有用的,因为前面的location ~* \.php$已经把“/结束”这种情况排除了
默认值:none
使用字段:http, server, location
如果URI以斜线结尾,文件名将追加到URI后面,这个值将存储在变量$fastcgi_script_name中。例如:
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/www/scripts/php$fastcgi_script_name;
请求"/page.php",参数SCRIPT_FILENAME将被设置为"/home/www/scripts/php/page.php",但是请求"/"则为"/home/www/scripts/php/index.php"。
2,
fastcgi_index:如果请求的FastCGI URI以/结束,该指令设置的文件会被附加到URI的后面并保存在变量$fastcgi_script_name中
index:该指令用于设置nginx的默认首页文件
而我们的配置经常是
location ~* \.php$ {
fastcgi_pass cos_ups;
fastcgi_index index.php;
include fastcgi.conf;
}
在这里指定fastcgi_index 其实是没有用的,因为前面的location ~* \.php$已经把“/结束”这种情况排除了
相关文章推荐
- nginx教程
- Linux--YUM 安装 nginx php mysql
- nginx+php使用open_basedir限制站点目录防止跨站
- Mac 系统 开启启动 nginx
- nginx日志切割,日志格式,静态文件不记录日志,配置缓存
- nginx+keepalived配置
- nginx探索--1
- nginx的优化配置参数
- nginx 实现域名的跳转
- Install nginx-clojure on CentOS 7
- Nginx安装google_perftools模块的方法
- ubuntu nginx install phpmyadmin
- Nginx配置文件中的location中文详解
- 利用ngxtop实时监控Nginx的访问情况
- 高流量站点NGINX与PHP-fpm配置优化
- nginx优化 突破十万并发
- Nginx系列(二十.)隐藏nginx版本号
- nginx配置在一台虚拟主机下多站点服务(对应多域名
- CentOS6.5 yum安装nginx
- nginx 安装