您的位置:首页 > 运维架构 > Nginx

centos nginx 之网站根目录路径修改

2016-12-07 15:35 337 查看
修改网站根目录

[root@admin /]# vim usr/local/nginx/conf/nginx.conf


######################## default ############################

  server {

  listen 80;

  server_name localhost;

  access_log /data/wwwlogs/access_nginx.log combined;

  root /data/wwwroot/default;

  index index.html index.htm index.php;

  location /nginx_status {

    stub_status on;

    access_log off;

    allow 127.0.0.1;

    deny all;

    }

  location ~ [^/]\.php(/|$) {

    #fastcgi_pass remote_php_ip:9000;

    fastcgi_split_path_info ^(.+\.php)(/.+)$;

    fastcgi_pass unix:/dev/shm/php-cgi.sock;

    fastcgi_index index.php;

    include fastcgi.conf;

    fastcgi_param   PATH_INFO   $fastcgi_path_info;

    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;

    }

将标注红色的root路径,修改为自己想要使用的根目录路径即可(注意:有些路径不可取)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: