百度云虚拟主机BCH如何绑定域名到指定文件夹目录

原创 小姚  2020-03-11 12:52  阅读 2,367 次

上次分享了阿里云虚拟主机绑定域名到指定文件夹的教程,今天来分享百度云虚拟主机BCH如何绑定域名到指定文件夹目录.

百度云虚拟主机BCH如何绑定域名到指定文件夹目录-小姚工作室

1.在网站根目录建bcloud_nginx_user.conf文件

2.复制如下代码:

error_page 502 /index.html;
 
error_page 404 /index.html;
if ($host = hao360.xyz) {
set $rootdir /home/bae/app/index;
}
if ($host = www.hao360.xyz) {
set $rootdir /home/bae/app/index;
}
if ($host = taobao.hao360.xyz) {
set $rootdir /home/bae/app/taobao;
}
if ($host = ie.hao360.xyz) {
set $rootdir /home/bae/app/ie;
}
if ($host = sd.hao360.xyz) {
set $rootdir /home/bae/app/sd;
}
if ($host = aqws.hao360.xyz) {
set $rootdir /home/bae/app/aqws;
}
if ($host = jd.hao360.xyz) {
set $rootdir /home/bae/app/jd;
}
if ($host = blog.hao360.xyz) {
set $rootdir /home/bae/app/blog;
}
if ($host = jie.hao360.xyz) {
set $rootdir /home/bae/app/jie;
}
location / {
root $rootdir;
index index.php index.html;
}

 

解释:

hao360.xyz为要绑定的域名,index为文件夹(目录),要绑定多少域名就复制几遍如下代码

if ($host = hao360.xyz) {
set $rootdir /home/bae/app/index;
}

点击下载bcloud_nginx_user.conf文件

本文地址:https://www.xiaoyaogzs.com/2820.html
关注我们:请关注一下我们的微信公众号:扫描二维码小姚工作室的公众号,公众号:小姚户外
版权声明:本文为原创文章,版权归 小姚 所有,欢迎分享本文,转载请保留出处!
NEXT:已经是最新一篇了

发表评论


表情