VPS侦探论坛

 找回密码
 注册
查看: 2819|回复: 1

怎么添加虚拟主机

[复制链接]
发表于 2016-12-15 19:25:36 | 显示全部楼层 |阅读模式

server
    {
        listen 80;
        #listen [::]:80 default_server ipv6only=on;
        server_name api.first.cn;
        index index.html index.htm index.php;
        root  /home/wwwroot/api.first.cn/public;

        #error_page   404   /404.html;
        include enable-php.conf;

        location /nginx_status
        {
            stub_status on;
            access_log   on;
        }
        
        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location ~ /\.
        {
            allow all;
        }
         access_log  /home/wwwlogs/access_check.log;
   }


在/home/wwwroot/建了个api.first.cn目录,在vhost下加了个api.first.conf,结果还是指向原来的目录
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-12-16 11:03:36 | 显示全部楼层
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 07:24 , Processed in 0.024907 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表