开发者社区 问答 正文

linux的服务器安装二级域名求解

主域名设置:

server {
        listen       80;
        server_name  aicheba.com;
        index index.html index.htm index.php;
        root /alidata/www;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        #伪静态规则
        include /alidata/server/nginx/conf/rewrite/phpwind.conf;
        log_format  www  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /alidata/log/nginx/access/phpwind.log www;
}

二级域名设置:
server {
        listen       80;
        server_name  news.aicheba.com;
        index index.html index.htm index.php;
        root /alidata/www/news;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        #伪静态规则
        include /alidata/server/nginx/conf/rewrite/default.conf;
        log_format  news  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /alidata/log/nginx/access/phpwind.log news;
}

两个同时不知道两个设置的对不对?求解~;要是同时存在网站打不开了....

展开
收起
花生cms 2013-12-28 23:14:48 7321 分享 版权
4 条回答
写回答
取消 提交回答
  • 元芳,阿里云云栖论坛总版主,phpwind官方论坛管理员,社区论坛领域应用专家。长期活跃在社区论坛建站领域,对各类社区论坛程序颇有研究!乐于交友,热心助人,以帮助和服务站长朋友为宗旨,帮助数以千计的站长朋友顺利建站!
    回 3楼(花生cms) 的帖子
    建议把配置文件分开
    http://help.aliyun.com/manual?spm=0.0.0.0.mLxy9Y&helpId=532
    可以参考这个教程
    2013-12-29 21:51:03
    赞同 展开评论
  • Relinux的服务器安装二级域名求解
    。。。。。
    2013-12-29 14:45:46
    赞同 展开评论
  • 伪静态设置的对?
    2013-12-29 11:13:19
    赞同 展开评论
  • 你发出来的部分没有啥问题,重启NGINX有没有错误提示。
    2013-12-29 08:05:53
    赞同 展开评论