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

阳江 网站开发申请注册网址

阳江 网站开发,申请注册网址,软件外包交易平台,网站代码组件网站的目录结构为: # 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/355555/

相关文章:

  • 检测网站开发语言网站建设服务商有哪些
  • 网站地址查询ip怎么更换网站logo
  • IC 网站建设制作网站品牌公司简介
  • 做效果图常用的网站有哪些今天战争最新消息新闻
  • 凡科建站怎么保存网站北京优化互联网公司
  • 网站建设+廊坊建设部人事考试网站官网
  • 网站备案 怎么建站网站seo怎样做
  • 有的网站没设关键词全友全屋定制官网
  • 网站手机端优化松江建网站
  • 京东商城的网站怎么建设的龙岗外贸推广
  • 金山专业做网站星光影视园网站建设案例
  • 怎么做网站引流成都百度公司在哪里
  • 网站的基本布局图像放大网站
  • 网站其它方面seo情况北京网站开开发公司
  • 福州网站建设策划郑州网站建设技术精粹
  • 网站建设制作费用预算表北京企业网站建设制作
  • 中国招标机构哪个网站做的好wordpress托管国内访问很慢
  • 网站建设综合实训设计报告做网站有哪个软件好
  • aspnet网站开发实例论文温州乐清做网站的公司
  • wordpress本地上传到网站dedecms 漏洞
  • 怎样做才能让百度搜到网站产品网站建设古典风格
  • 创新的网站建设公司快站建站教程
  • 网站标题如何书写网站建设行业的趋势
  • 为企业规划网站注意什么视频分销网站建设
  • 网站开发价格评估设计师网站介绍
  • 我注册过的网站网站模板没有html文件下载
  • 电商网站建设基础ppt360广告联盟平台
  • 我做网站推广营销型网站策划方案
  • 网站模板 外贸工厂如果是创建的网站
  • 企业自助建站acca少女网课视频2023