Instances and domain names

Cabloy supports the development of multi-domain sites through the concept of multi-instance, with instances corresponding to the subdomains of the website. Such as and

In the local development environment, Cabloy has enabled a default instance; but in a production deployment environment, you need to plan the mapping between instances and subdomains.

In the Cabloy-CMS application, domain name has left for static files, so you need to assign a subdomain to the backend management system, such as

Multi-site support

Since one instance corresponds to one CMS application, multiple sites can be supported by multiple instances.

Instance configuration

Edit file: src/backend/config/

// instances
config.instances = [
  { subdomain: 'admin', password: '', title: '',
    config: {
      'a-base': {
        jsonp: { whiteList: '' },
Name Instruction
subdomain subdomain
password The initial access password of the user root in the instance
title Website title
config[‘a-base’].jsonp.whiteList Cross-domain access whitelist, only domain names in the whitelist can access the backend API interface through ajax

Build frontend code

$ npm run build:front

Start backend service

$ npm run start:backend

  • Do not forget to create a MySQL database and configure src/backend/config/

Stop backend service

$ npm run stop:backend

Backend service startup parameter configuration

Edit file: build/config.js:

// backend
const backend = {
  port: 7002,
  hostname: '',

Nginx configuration

It is highly recommended to use nginx to host frontend static resources and to apply reverse proxy to backend services.

Two nginx configuration files have been generated in the project root directory, which correspond to the dynamic and static parts of Cabloy-CMS respectively. Please modify them according to actual needs.

Dynamic part: nginx.conf

server {

  listen 80;
  set $node_port 7002;

  root /Users/wind/Documents/temp/cabloy-cms/dist;

  location /public {
    root /Users/wind/cabloy/cabloy-cms;

  location  /api/ {
    proxy_http_version 1.1;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $server_name;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-NginX-Proxy true;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_redirect off;


Static part: nginx-cms.conf

server {

  listen 80;

  root /Users/wind/cabloy/cabloy-cms/public/1/cms/dist;