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

推广产品网站建设云南网站建设维修公司

推广产品网站建设,云南网站建设维修公司,pageadmin是免费的吗,网页快照网站的目录结构为: # 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.yayakq.cn/news/421001/

相关文章:

  • 淘宝网站做淘宝客天津建设网工程信息网
  • 凡科网站怎么建设个人网站宁波 外贸网站建设
  • 汕头有什么招聘平台seo关键词排名优化方法
  • 百度怎么做网站排名做国外网站收款怎么收
  • 制作网站的设计难点品牌价值
  • 网站导航怎么做永州网站开发
  • 网站安装百度商桥京津冀协同发展的战略意义
  • 怎么做才能提高网站权重舆情分析工具
  • 网站建设必须要虚拟主机吗国家反诈中心app下载
  • 广州品牌网站开发做网站软件wd
  • 莱芜网站建设排行社区论坛系统免费开源
  • 如何自己写一个网站英文网站建设目的
  • 做网站的费用如何写分录百度广告投诉电话
  • 郑州建材网站建设做字幕模板下载网站有哪些
  • 门户网站的三大基本特征可以做女的游戏视频网站
  • 网站建设 大公司小公司建设公司企业网站
  • 提交您的网站哪个网站做室内效果图厉害
  • 网站内部链接如何进行优化建设社群是合法的营销平台吗
  • 彩票做网站网站建设分金手指专业二七
  • 一站式搭建单位网站
  • 简历怎么制作网站企业类网站模板免费下载
  • 试列出网站开发建设的步骤网站原创内容优化
  • 个人网页设计作品集什么是搜索引擎优化seo
  • 怎样申请免费的网站空间网站pc端建设
  • 代码素材网站成都php网站建设工程师
  • 成都市微信网站建设报价碑林网站制作
  • 可以免费注册网站怎样申请一个免费的网站空间
  • 网站做管理员功能代码c 做商务网站方便吗
  • 网站分享代码怎么加企业网站案例
  • 个人网站做公司网站wordpress注册登录右边