当前位置: 首页 > news >正文

做网站id湖南seo博客seo交流

做网站id,湖南seo博客seo交流,深圳航空公司订票电话,网站搭建费用网站的目录结构为: # tree /home/wwwroot/landui.com /home/wwwroot/landui.com ├── bbs │ └── index.html └── www └── index.html 2 directories, 2 files /home/wwwroot/landui.com为nginx的安装目录下默认的存放源代码的路径。 bbs为论坛…

网站的目录结构为:

# tree /home/wwwroot/landui.com

/home/wwwroot/landui.com

├── bbs

│   └── index.html

└── www

    └── index.html

2 directories, 2 files

/home/wwwroot/landui.com为nginx的安装目录下默认的存放源代码的路径。

bbs为论坛程序源代码路径;www为主页程序源代码路径;把相应程序放入上面的路径通过;http://www.landui.com 访问的就是主页http://www.landui.com 访问的就是论坛,其它二级域名类推。

有2种方法,推荐方法一

方法一:

server {

listen 80;

server_name ~^(?<subdomain>.+).landui.com$;

access_log /data/wwwlogs/landui.com_nginx.log combined;

index index.html index.htm index.php;

root /home/wwwroot/landui/$subdomain/;

location ~ .php$ {

    fastcgi_pass unix:/dev/shm/php-cgi.sock;

    fastcgi_index index.php;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    include fastcgi_params;

    }

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {

    expires 30d;

    }

location ~ .*\.(js|css)?$ {

    expires 7d;

    }

}

方法二:

server {

listen 80;

server_name *.landui.com;

access_log /home/wwwlogs/landui.com_nginx.log combined;

index index.html index.htm index.php;

if ($host ~* ^([^\.]+)\.([^\.]+\.[^\.]+)$) {

    set $subdomain $1;

    set $domain $2;

}

location / {

    root /home/wwwroot/landui.com/$subdomain/;

    index index.php index.html index.htm;

}

location ~ .php$ {

    fastcgi_pass unix:/dev/shm/php-cgi.sock;

    fastcgi_index index.php;

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    include fastcgi_params;

    }

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {

    expires 30d;

    }

location ~ .*\.(js|css)?$ {

    expires 7d;

    }

}

另外: 如果是根据二级名称 分发到不同服务上

若是通配: *.xxxx.com 则需要配置 二级域名的名称获取:

 set $subdomain '';if ($host ~* ^(.*?)\.mydomain.net) {set $subdomain $1;}

然后根据名称 方发到不同的服务:

# subdomain的值是根据二级域名正则匹配出来的
    if ($subdomain ~* ^(bi|cd|doc)$) {
        # 当subdomain匹配app1、app2或app3时,执行以下操作
        proxy_pass http://192.1.4.6:8080;
    }
    if ($subdomain = git) {
        proxy_pass http://192.1.4.7:8080;
    }

http://www.tj-hxxt.cn/news/16192.html

相关文章:

  • 福田专业网站建设公司seo现在还有前景吗
  • 手机黄山网站网站排名优化师
  • 网站建设 简易合同高端网站建设哪家便宜
  • 酒泉做网站做网站的平台
  • 人民日报客户端appseo优化流程
  • 舟山建设银行网站搜索引擎优化是什么工作
  • 上海电子商务网站宁波网络推广产品服务
  • 网站建设服务方案ppt营销型网站建设推荐
  • 网站定制文章列表项怎么做系统优化app最新版
  • 宁波免费建站外包公司网站收录查询平台
  • 免费友情链接平台北京网络排名优化
  • 松江区做网站的公司排名优化方案
  • 昆明网站做2021百度新算法优化
  • 网站怎么做移动图片优速网站建设优化seo
  • 有没有做网站的多少钱网店培训机构
  • 杭州 电子商务网站建设网站代发外链
  • 赣州大余做网站建设网络整合营销4i原则
  • 阿拉山口网站建设广告公司简介
  • 网站建设基础内容独立站谷歌seo
  • 东莞做网站建设排名优化
  • 公司做网站需要哪些资料网络建站
  • 轻松做网站网站推广推广
  • wordpress 评论弹窗登陆济南seo优化外包服务
  • 单页网站模板修改吗舆情报告
  • 旅游电子商务网站的建设方式win7优化大师好不好
  • 专注新乡网站建设长尾关键词挖掘词工具
  • 手机端网站制作教程真正免费建站网站
  • 做旅游网站设计的感想google关键词推广
  • 企业官方网站建设教程手机怎么制作网站
  • 湖北纪委监委网站廉政建设展示湖北百度seo排名