zoukankan      html  css  js  c++  java
  • 百度云虚拟主机BCH部署多个vue项目

    注意:此文章使用百度云虚拟主机BCH服务器web内核用Nginx,PHP版本7.0。

    第一步:再php配置里把URL_MODEL 配置成2,重写模式;

    第二步:在网站的根目录里面(webroot目录下)新建一个bcloud_nginx_user.conf文件(bch是不允许修改基础配置文件的,所以只能通过加载用户自定义配置文件),写入如下代码:

    location /hehe {
        if (!-e $request_filename) {
            rewrite .* /hehe/index.php last;
        }
    }

    以上代码实现在‘hehe’目录下指向不存在文件,则重定向至/hehe/index.php文件

    第三步:在主机控制面板中找到站点启停,点击重载站点服务。(切记修改完规则之后一定要重新加载否则不能生效)

    多个vue项目部署在此处依然生效

    location /hehe {
        if (!-e $request_filename) {
            rewrite .* /hehe/index.php last;
        }
    }
    location /website_admin {
        if (!-e $request_filename) {
            rewrite .* /website_admin/index.html last;
        }
    }
    location /website {
        if (!-e $request_filename) {
            rewrite .* /website/index.html last;
        }
    }

    Nginx配置文件加载流程

    系统启动后将自动加载bcloud_nginx_gen.conf和bcloud_nginx_user.conf配置文件:

    bcloud_nginx_gen.conf文件是由app.conf文件转换的。

    bcloud_nginx_user.conf为用户自定义配置文件。用户可在程序根目录下,创建bcloud_nginx_user.conf文件,在文件里写入自定义配置。BCH支持server级别以下的自定义配置。

    当出现重复配置时,bcloud_nginx_user.conf优先级高于bcloud_nginx_gen.conf。

    常见程序百度云伪静态规则

    http://z.admin5.com/index.php?r=index/rewrite

  • 相关阅读:
    js如何将字符串作为函数名调用函数
    js如何生成[n,m]的随机数
    UIMenuController,UIPasteboard:复制,粘贴详细解释
    python2.7和 python3.4但是不要
    Android IPC通信和AIDL技术应用
    可穿戴式智能设备,其潜在的安全问题?(上)
    CentOS安装KVM步骤虚拟机,绝对实用!
    Python于*args 和**kwargs使用
    uva 1556
    JSCover+WebDriver/Selenium获得JS 代码覆盖
  • 原文地址:https://www.cnblogs.com/linfblog/p/12123367.html
Copyright © 2011-2022 走看看