As an experienced CMS website operation personnel for a security company, I am well aware of the importance of efficiently and safely managing each site in a multi-site environment.Among other things, setting a separate backend domain for each site is an effective means to enhance security, and it is also a critical step for achieving brand separation and specialized operations.Next, I will elaborate on how to configure an independent backend domain for each site under the AnQiCMS multi-site architecture.

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

AnQiCMS with its powerful multi-site management feature allows operators to easily manage multiple brands or projects within a single system. However, when the number of sites increases, the default backend access path (usually the frontend domain followed by/systemMay cause confusion in management, or may not appear professional under certain security requirements. Configure an independent backend domain for each site, for example,www.example.com/systemtoadmin.example.comIt can significantly enhance the security of the backend, prevent vulnerabilities in front-end applications from affecting the backend entry, and establish a clear and independent brand image 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 between the server level (DNS resolution and web server configuration) and the AnQiCMS backend level (global settings) is required.

Preparation: Domain Name Resolution and Reverse Proxy Configuration

Before you begin AnQiCMS backend settings, make sure all involved domains are correctly resolved and pointed to your server's IP address. This includes your new site's 'frontend domain' (for examplenewsite.comincluding the "independent backend domain" planned for it (e.g., admin.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 the AnQiCMS application is listening on (AnQiCMS defaults to listening on port 8001).

For an Nginx server, you need to add the corresponding configuration block for each frontend domain and independent backend domain.serverEachserverAll blocks should proxy requests to the internal running port of AnQiCMS. For example, if your AnQiCMS main program is running in127.0.0.1:8001So, the Nginx configuration may include the following similar snippets, which handle 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 Nginx or Apache configurations to make the changes take effect.This step is the key to ensure that the independent backend domain can be correctly routed to the AnQiCMS application.

Create or manage a new site in the main backend of AnQiCMS

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.

Site Name: Name your new site for easy management and distinction. Site Root Directory: Set an independent directory path, for example:/app/dev_anqicms.comused to store the cache, logs, and other data of the site. Website address: Fill in the frontend access domain name of the new site, for examplehttp://dev.anqicms.com. Administrator account and password: Set the new site's backend administration account and password. Database name: Specify a new database to store the site's data, for exampledev_anqicms_com。 Database information reuse: Choose whether to reuse the default database account information based on your deployment situation. Choose the template to use: Select a suitable template for the new site.

After completing the information entry and confirmation, 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 directly enter the backend of the new site by clicking the "Access Backend" button in the multi-site management list, or directly enter the frontend domain of the new site into the browser (for examplehttp://dev.anqicms.com/systemEnter.

Navigate to the 'Global Function Settings' under 'Admin Settings' in the left menu after logging into the background management interface of the new site.In this settings page, you will find an input box named "Backend Domain Address".https://admin.newsite.com.

Please make sure that the domain entered includes the full protocol (http://orhttps://)。Before filling in and saving this setting, the domain resolution and Web server reverse proxy mentioned earlier must already be properly configured and effective; otherwise, you will not be able to access the backend through this standalone domain.https://admin.newsite.comAccess the admin interface of the site.

Summary

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


Common Questions and Answers (FAQ)

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

There are mainly three benefits to setting an independent backend domain.Firstly, enhance security by separating the backend management entry from the frontend website, reducing the risk of backend being attacked due to frontend application vulnerabilities.The translation to [en] is: 'It is followed by brand independence, each site has an independent management entrance, which aligns with its independent brand positioning, showcasing a more professional image to the outside world.'It is the convenience of management. In multi-site operations, by using a separate domain, you can directly locate the backend of a specific site, 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 frontend domain of the site plus/system/Path as the backend access entry. For example, if your frontend domain iswww.example.com, then the backend entry will bewww.example.com/system/.This approach is feasible for a single site or in scenarios with low security requirements, but in a multi-site environment or when pursuing higher security, setting up an independent backend domain would be a better choice.

Will my front-end website be affected after configuring an independent backend domain?

Will not be affected.Configure an independent backend domain for the AnQiCMS site, which only changes the access entry of the backend management interface.The 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 backend management experience and security, which is separate from the operation logic of the front-end website.