Chinaunix首页 | 论坛 | 博客
  • 博客访问: 54725
  • 博文数量: 65
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 365
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-06 10:38
文章分类
文章存档

2015年(65)

我的朋友

分类: LINUX

2015-01-23 15:47:19

nginx新手配置$document_root

nginx配置老是出错,最后才发现是$document_root的设置问题。

            location ~ \.php$ {

            root           html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

        }

这个用出现找不到php的错误。因为$document_root 的参数是由root html那一行定义的,默认是在/etc//html/ 所以把 html换成站点根目录就正常了。

            loion ~ \.php$ {

            root           /usr/share/nginx/html;

            fastcgi_pass   127.0.0.1:9000;

            fastcgi_index  index.php;

            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

            include        fastcgi_params;

        }

 

  • 本文来自:
阅读(273) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~