As an experienced CMS website operation manager, I am well aware of the importance of managing each site efficiently and securely in a multi-site environment.Among them, setting up an independent backend domain for each site is not only an effective means of enhancing security, but also a key step to achieve brand separation and specialized operation.Next, I will elaborate on how to configure independent backend domains for each of your sites under the AnQiCMS multi-site architecture.

The importance of AnQiCMS multi-site management and independent backend domain

AnQiCMS with its powerful multi-site management features allows operators to easily manage multiple brands or projects within a single system. However, as the number of sites increases, the default backend access path (usually the domain name followed by/system)Could lead to confusion in management, or may not be professional enough under specific security requirements. Configure a separate backend domain for each site, such as settingwww.example.com/systemchanged toadmin.example.comIt can significantly enhance the security of the background, prevent front-end application vulnerabilities from affecting the back-end entry, and at the same time, establish clear and independent brand images for each site, improving management efficiency and professionalism.

Configure detailed steps for an independent backend domain

To set up independent backend domain names for each site in AnQiCMS multi-site, close collaboration is required between the server level (DNS resolution and web server configuration) and the AnQiCMS backend level (global settings).

Preparation work: Domain resolution and web server reverse proxy configuration

Before you start setting up the AnQiCMS backend, make sure all involved domains are correctly resolved and point to your server IP address. This includes the "front-end domain" of your new site (such asnewsite.com) as well as the independent backend domain planning (for exampleadmin.newsite.com)

Next, your web server (such as Nginx or Apache) needs to configure reverse proxy for these domains, forwarding external requests to the internal port that AnQiCMS application is listening on (AnQiCMS listens on port 8001 by default).

For the Nginx server, you need to add the correspondingserverblock configuration for eachserverAll blocks should proxy requests to the internal running port of AnQiCMS. For example, if your AnQiCMS main program is running on127.0.0.1:8001Then the Nginx configuration may include the following similar segments, handling the front-end domain and its corresponding back-end domain:

server {
    listen 80;
    server_name newsite.com www.newsite.com;
    root /www/wwwroot/newsite.com/public; # 请替换为您的站点根目录,并指向AnQiCMS的public目录

    location @AnqiCMS {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
    error_page 404 =200 @AnqiCMS;
    location / {
       try_files $uri $uri/index.html @AnqiCMS;
    }
}

server {
    listen 80;
    server_name admin.newsite.com; # 独立的后台域名
    root /www/wwwroot/anqicms_main_instance/public; # 可以指向AnQiCMS主程序的public目录,或者保持一致

    location @AnqiCMS_Admin {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }
    error_page 404 =200 @AnqiCMS_Admin;
    location / {
       try_files $uri $uri/index.html @AnqiCMS_Admin; # 这里的try_files对于后台可能不是必需的,但确保请求能被代理
    }
}

Make sure to reload or restart your web server after modifying the Nginx or Apache configuration to make the settings take effect.This step is the key to ensure that the independent background domain can be correctly routed to the AnQiCMS application.

Create or manage a new site in the AnQiCMS main backend

If you have not created a new site in the multi-site, you need to log in to the backend management interface of your AnQiCMS main site.Find and click the "Multi-site Management" feature in the left menu.Here, you can 'add a new site' and fill in the following information:

Site Name: Name your new site for easy management and distinction. Site Root Directory: Set an independent directory path, for example/app/dev_anqicms.comThis is used to store the cache, logs, and other data of the site. Website address: Enter the front-end access domain name of the new site, for examplehttp://dev.anqicms.com. Admin account password: Set the admin account and password for the new site. Database name: Specify a new database to store the site data, such asdev_anqicms_com. Database information reuse: Select whether to reuse the default database account information based on your deployment situation. Select the template to use: Choose a suitable template for the new site.

After completing and confirming the information, AnQiCMS will create a brand new, independent site instance for you within the system.

Configure the independent backend domain for the new site.

Now, the most critical step is to configure a separate backend domain for your new site. You can choose to access the backend of the new site directly through the "Access Backend" button in the multi-site management list, or directly enter the frontend domain of the new site in the browser (for examplehttp://dev.anqicms.com/systemEnter.

After entering the background management interface of the new site, navigate to the "Global Function Settings" under "Background Settings" in the left menu.In this settings page, you will find an input box named "backend domain address".Enter the independent backend domain name you plan for the site, for examplehttps://admin.newsite.com.

Please note that the domain entered must include the full protocol.http://orhttps://)。Before filling in and saving this setting, the domain resolution and Web server reverse proxy mentioned earlier must be properly configured and activated; otherwise, you will not be able to access the backend through the independent domain.Save the settings and then you can go through directly next timehttps://admin.newsite.comAccess the backend management interface of the site.

Summary

By following these steps, you have successfully set up a separate backend domain for each site in the AnQiCMS multi-site.This not only optimizes your content management process, but also takes an important step in terms of security, brand independence, and operational professionalism.As operation staff, we know that details determine success or failure, and an independent backend domain is an indispensable part of these details.


Frequently Asked Questions (FAQ)

1. Why is it recommended to set a separate backend domain for each site?

Setting a separate backend domain has three main benefits. The first is to enhance security, separating the backend management entry from the front-end website, reducing the risk of backend attacks due to vulnerabilities in front-end applications.The brand independence comes next, each site has an independent management entry, in line with its independent brand positioning, and presents more professionalism externally.The last is the convenience of management, in multi-site operations, through independent domain names, you can directly locate to the backend of specific sites, reduce confusion, and improve work efficiency.

2. How will my AnQiCMS backend access if I do not set a separate backend domain?

If you do not set a separate backend domain for the site, AnQiCMS will default to using the site's front-end domain plus/system/The path is used as the back-end access entry. For example, if your front-end domain iswww.example.com, then the back-end entry will bewww.example.com/system/This approach is feasible in a single site or in scenarios with low security requirements, but setting up an independent backend domain would be a better choice in a multi-site environment or when pursuing higher security.

3. Will my front-end website be affected after configuring a separate backend domain?

It will not be affected. Configure an independent backend domain for the AnQiCMS site, which only changes the access entry of the backend management interface.Normal access to the front-end website (through its front-end domain) and the display of its content will not be affected at all.This is an independent configuration item, designed to optimize the background management experience and security, and is separated from the operation logic of the front-end website.