首页 > 其他 > 详细

配置虚拟主机

时间:2016-01-04 07:43:38      阅读:191      评论:0      收藏:0      [点我收藏+]

cd /usr/local/nginx/conf

mkdir vhosts

cd vhosts

vim default.conf

server

{

    listen 80 default_server;

    server_name localhost;

    index index.html index.htm index.php;

    root /tmp/123;

deny all

    location ~ \.php$ {

        include fastcgi_params;

        fastcgi_pass unix:/tmp/php-fcgi.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;

    }


}

mkdir /tmp/123

/etc/init.d/nginx reload 重新加载配置文件




标准配置

server

{

    listen 80;

    server_name localhost;

    index index.html index.htm index.php;

    root /usr/local/nginx/html;


    location ~ \.php$ {

        include fastcgi_params;

        fastcgi_pass unix:/tmp/php-fcgi.sock;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;

    }


}



本文出自 “10897714” 博客,请务必保留此出处http://10907714.blog.51cto.com/10897714/1731221

配置虚拟主机

原文:http://10907714.blog.51cto.com/10897714/1731221

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!