`
xitongyunwei
  • 浏览: 930022 次
文章分类
社区版块
存档分类
最新评论

nginx配置DocumentRoot

 
阅读更多

nginx配置DocumentRoot


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;
}

Nginx的$document_root 的参数是由root html那一行定义的,默认是在/etc/nginx/html/所以把 html换成站点根目录就可以了。

location ~ \.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;
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics