码迷,mamicode.com
首页 > 其他好文 > 详细

lnmp一键安装包 配置多站点

时间:2018-05-21 16:20:42      阅读:637      评论:0      收藏:0      [点我收藏+]

标签:stc   index.php   一键   ati   style   code   span   com   pass   

在/usr/local/nginx/conf/vhost下配置多站点的文件,一个站点对应一个文件,配置如下信息:

vim ./vhost/test.conf

server {
    listen       80; 
    server_name  www.centos.com    centos.com;
    root   /home/wwwroot/test;
    location / {
        index index.php;
        #autoindex on;
    }   

    location ~ \.php$ {
        include /usr/local/nginx/conf/fastcgi.conf; 
        fastcgi_pass unix:/tmp/php-cgi.sock;
        fastcgi_param SCRIPT_FILENAME /home/wwwroot/test$fastcgi_script_name;
    }
}

vim ./vhost/mytest.conf

server {
    listen       80; 
    server_name  www.centostest.com    centostest.com;
    root   /home/wwwroot/centostest;
    location / {
        index index.php;
        #autoindex on;
    }   

    location ~ \.php$ {
        include /usr/local/nginx/conf/fastcgi.conf; 
        fastcgi_pass unix:/tmp/php-cgi.sock;
        fastcgi_param SCRIPT_FILENAME /home/wwwroot/centostest$fastcgi_script_name;
    }
}

 

lnmp一键安装包 配置多站点

标签:stc   index.php   一键   ati   style   code   span   com   pass   

原文地址:https://www.cnblogs.com/walblog/p/9067263.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!