全球主机交流论坛

标题: 50分求解决 nginx中怎么批量让二级域名绑定到子目录? [打印本页]

作者: netrefugee    时间: 2013-1-9 20:24
标题: 50分求解决 nginx中怎么批量让二级域名绑定到子目录?
我在your.com.conf添加几个二级域名和子目录好像没什么反应,二级域名都绑定到一级域名那个目录了,我想绑定到已经存在子目录要怎么修改呢,可以批量添加二级子目录地址吗?

比如绑定
a.baidu.com到baidu.com/a
b.baidu.com到baidu.com/b
c.baidu.com到baidu.com/c
等等,
要怎样才能批量添加二级域名到子目录呢
作者: SunnyV    时间: 2013-1-9 20:26
100分帮你
作者: netrefugee    时间: 2013-1-9 20:30
SunnyV 发表于 2013-1-9 20:26
100分帮你

PM
作者: 游离者    时间: 2013-1-9 21:54
提示: 作者被禁止或删除 内容自动屏蔽
作者: lutaf    时间: 2013-1-9 23:02
easy
不好描述
你把你的nginx.conf贴上来,以及你要修改的域名和路径都贴上来

帮你改好
作者: a219549    时间: 2013-1-31 11:16
铜球该问题的解决方案
作者: Zoplor    时间: 2013-1-31 11:17
    不会帮忙顶  
作者: chairo    时间: 2013-1-31 11:28
本帖最后由 chairo 于 2013-1-31 11:33 编辑

俺的一个类似的泛域名的nginx config文件
server
        {
                listen       80;
                server_name 94425.com *.94425.com;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/94425.com;

        if ($uri ~* "/(.*)/(.*)/(.*)\.html") {
            rewrite "^/(.*)/(.*)/(.*)\.html$" /$1/$2/$3.html last;
        }

        if ($host ~* "([^www].*)\.94425\.com") {
            set $subdomain $1;
            rewrite "^/(.*)$" /$subdomain/$1 last;
        }


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

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

                location / {
            include uwsgi_params;
            uwsgi_pass 127.0.0.1:9090;
            uwsgi_param UWSGI_PYHOME /usr;
            uwsgi_param UWSGI_CHDIR /home/wwwroot/94425.com;
            uwsgi_param UWSGI_SCRIPT app;
            uwsgi_param SCRIPT_NAME /;
            uwsgi_param SERVER_NAME 94425.com;
        }

                access_log off;
        }

作者: jumpsky    时间: 2013-1-31 12:52
server_name baidu.com *.baidu.com;

作者: 爱国者捣蛋    时间: 2013-1-31 12:58
帮顶




欢迎光临 全球主机交流论坛 (https://443502.xyz/) Powered by Discuz! X3.4