How to implement multi-site deployment of AnQiCMS through reverse proxy in Docker on Baota panel?

Calendar 👁️ 92

AnQiCMS (AnQiCMS) with its powerful multi-site management capabilities, provides great convenience for operators.In the Docker environment of Baota panel, the multi-site deployment of AnQiCMS through reverse proxy can not only effectively isolate the running environment of different sites, but also make full use of the built-in multi-site function of AnQiCMS, thereby realizing efficient content management and resource integration.As an experienced website operator specializing in Anqi CMS, I will elaborate on this deployment process to help you easily manage multi-site operations.

Preparation and Core Service Deployment

Before starting the multi-site deployment, you need to make sure that the Baota panel is correctly installed and that the Docker service is running normally.The core service of AnQi CMS is usually deployed through a Docker container.This means you just need to run a Docker container instance of AnQiCMS to create and manage multiple independent websites in its powerful backend management system.

First, refer to the installation guide for AnQiCMS in the Baota panel Docker environment, and successfully deploy the first AnQiCMS instance.During this process, you need to install Docker version of MySQL and note down its root password, as the database configuration of the subsequent new site will reuse this information.When the AnQiCMS container starts and binds to the local port (usually 8001), use the Baota panel's reverse proxy to point your main domain to the container service.After completing this step, your first AnQiCMS website will be able to access normally and will have an initial administrator account and password.

Add Reverse Proxy Site on Baota Panel

When your AnQiCMS core service runs in Docker and listens on an internal port (such as127.0.0.1:8001When it is necessary to bind a domain to a new site and point it to the AnQiCMS service, it is necessary to use the reverse proxy function of the Baota panel.

First, log in to your Baota panel. In the left navigation bar, select the "Website" menu, and then switch to the "Reverse Proxy" tab.Click the "Add Reverse Proxy" button to start configuring the domain for the new site.In the pop-up configuration interface, you need to make the following settings:

Enter your new site's domain name in the “Domain” field, for exampledev.anqicms.com. This domain must have been resolved to your server's IP address.

The 'Target URL' points to the internal address and port that your AnQiCMS Docker container is listening on. Typically, this should be filled in here.https://en.anqicms.comIf your AnQiCMS Docker container is listening on a different port, please adjust it according to the actual situation.

After confirming that the configuration is correct, click the "Submit" button. The Baota panel will automatically create and configure the reverse proxy rules for the domain name for you, so that external requests can be forwarded to your AnQiCMS service.

Configure a new site on the AnQi CMS backend

After the reverse proxy configuration is complete, you need to go to the AnQiCMS backend management interface to formally create and configure a new site.AnQiCMS has a complete multi-site management feature, allowing you to manage all sites from a single backend.

Log in to the AnQiCMS backend of your main site, navigate to the 'Multi-site Management' function area.Click the "Add New Site" button to start configuring a new site.In this interface, you need to fill in the information carefully:

The "site name" can be named according to your actual needs, which helps you distinguish different sites on the backend.

The 'site root directory' is a critical setting, used to independently store new site cache, static files, and other data to ensure data isolation between different sites. Since AnQiCMS runs in a Docker container, the file system path is unified from/app/Start. Therefore, it is recommended that you follow/app/Name it by replacing the dot in the domain name with an underscore, for example, if the new site domain isdev.anqicms.comthen the site root directory can be set to/app/dev_anqicms_comMake sure that the root directory name for each site is unique.

“Website address”enter the complete URL of the new site, for examplehttp://dev.anqicms.com.

Set an independent “admin account password” for the new site, which will be your credential for future login to the site backend.

The database name also needs to specify a unique database for the new site. To maintain consistency and facilitate identification, you can continue to use the method of replacing the dot in the domain name with an underscore, for exampledev_anqicms_com.

In the "Database Information Reuse" option, since your AnQiCMS is deployed using Docker and usually only one MySQL instance serves all sites, choosing "Reuse Default Database Account Information" will be the most convenient way.AnQiCMS will use the MySQL root account and password you configured during Docker installation to create a database for the new site.

Finally, select a template suitable for the new site, then click the "OK" button to complete the creation of the new site.AnQiCMS will automatically initialize all the necessary data tables and basic configurations for a new site in the newly created database.

Access and verify the new site

After completing the reverse proxy configuration of the Baota panel and the creation of the new site in the AnQiCMS backend, your new site has been successfully deployed.

You can enter the domain name of the new site in the browser, for examplehttp://dev.anqicms.com/Visit the new site's frontend page and perform the initial installation (if AnQiCMS does not automatically jump to the installation interface).In most cases, AnQiCMS will recognize new domain names and guide you through the initial setup.

To access the backend management interface of the new site, just add it to the domain name of the new site/system/Path, for examplehttp://dev.anqicms.com/system/. Log in with the administrator account and password you set up on the new site to start managing the content of the new site.

In this way, you successfully used reverse proxy and the built-in multi-site feature of AnQiCMS in a Docker container instance to achieve independent deployment and centralized management of multiple sites.This greatly simplifies operation and maintenance work, improving the efficiency of multi-site operation.


Frequently Asked Questions (FAQ)

1. Why do I only need to deploy one AnQiCMS Docker container instance to achieve multi-site management instead of deploying a container for each site?

This is because AnQiCMS considered the need for multi-site management from the very beginning.It comes with a site management module that allows the creation and management of multiple logically independent sites within the same AnQiCMS application instance.Each site has its own database, file directory (used for caching, uploading, etc.), templates, and configurations.The Docker container provides a unified runtime environment here, while the AnQiCMS application itself is responsible for the internal multi-site routing and data isolation.This model has lower resource usage and is also more centralized and efficient in management.

What is the significance of specifying the 'site root directory' and 'database name' when creating a new site in the AnQiCMS backend?

The root directory of the site is designed to provide each new site with an independent file storage space for storing their respective caches, attachments, logs, and other files. In the Docker environment, this directory needs to start with a path accessible within the container, for example/app/In order to avoid file path conflicts between different sites, it is recommended to use domain names for naming (such asdev_anqicms_com)

The database name is to create an independent database instance for a new site, ensuring that the data of each site does not interfere with each other. Similarly, use the domain name as part of the database name (such asdev_anqicms_comIt helps to clearly identify and manage each site's data at the database level.Due to the Docker installation of AnQiCMS usually sharing a MySQL service, simply select 'Reuse default database account information' when creating a new site, AnQiCMS will use the configured permissions to create a new database.

3. How to troubleshoot when accessing the new site after deployment and encountering "502 Bad Gateway" or "404 Not Found" errors?

If a "502 Bad Gateway" error occurs, it usually means that the Baota reverse proxy failed to successfully connect to the AnQiCMS Docker container service. You need to check:

  • Is the AnQiCMS Docker container running normally? (Check in the Baota Docker management interface)
  • Is the target URL of Baota reverse proxy correctly pointing to the internal IP and port of the AnQiCMS container (such ashttps://en.anqicms.com)?
  • Does the server firewall or security group block access to the internal port?

If a "404 Not Found" error occurs, this usually indicates that the reverse proxy has successfully forwarded the request, but the AnQiCMS application internally could not find the corresponding site or page. You need to check:

  • Have you successfully added the site in the "Multi-site Management" of the AnQiCMS backend?
  • Does the "Website Address" in the site configuration match the domain name you are visiting exactly (includinghttp/https)?
  • Does the new site need to be initially installed? Try to accesshttp://your-new-domain.com/system/Check if you can enter the backend login or installation interface.
  • Are the static rules configured correctly? Although most of the reverse proxy has been handled, the URL rewriting within AnQiCMS also depends on its own static rules configuration.

Related articles

How to use aaPanel (Baota International Edition) to one-click deploy AnQiCMS in Docker environment?

As a website administrator who deeply understands the operation of AnQiCMS, I know the importance of efficient deployment for the content management system.In today's cloud-native era, the combination of Docker with panel tools provides us with great convenience.AnQiCMS as an enterprise-level content management system developed based on the Go language, with its high efficiency, security, and SEO-friendly features, has become the preferred choice for many small and medium-sized enterprises and content operation teams.Deploy AnQiCMS in Docker environment through aaPanel (Baota International Edition), which can simplify the installation process

2025-11-06

How to install and deploy AnQiCMS using 1Panel in Docker environment?

As a senior website operator, I am well aware of the importance of an efficient, stable, and easy-to-manage content management system (CMS) for corporate websites.AnQiCMS (AnQiCMS) takes advantage of the lightweight and efficient characteristics of the Go language, as well as its rich functional modules, and has become the preferred choice for many small and medium-sized enterprises and content operation teams.In modern operation and maintenance environments, Docker containerization technology combined with a visual management panel like 1Panel can greatly simplify the deployment process and improve management efficiency.Next, I will give you a detailed introduction on how to use Docker environment

2025-11-06

Which operating systems does AnQiCMS support for deployment and testing?

As a senior CMS website operation person in the security field, I know the importance of the convenience of deployment and cross-platform compatibility of a content management system for efficient operation.The AnQi CMS, developed efficiently and securely based on the Go language, provides excellent content management capabilities while fully considering the deployment and testing requirements in different operating system environments, striving to bring flexible and stable user experience.On the server side, Anqi CMS provides comprehensive deployment support for mainstream Linux operating systems.

2025-11-06

What security mechanisms does AnQiCMS have in place to ensure content compliance?

As a senior website operations manager, I know that content compliance is the foundation of healthy website operation.AnQiCMS (AnQiCMS) places content security and compliance at a prominent position in its design philosophy, providing operators with a set of mechanisms to ensure the quality and legality of content.By delving deeply into its functional modules, I will elaborate on how AnQiCMS achieves this goal on multiple levels.

2025-11-06

What are the detailed steps for installing AnQiCMS with Docker on Baota panel?

As an experienced security CMS website operator, I know that a smooth deployment process is crucial for the quick launch and stable operation of the website.Our team loves AnQi CMS for its lightweight, efficient Go language and powerful SEO features.Deploying AnQi CMS by combining Baota panel and Docker technology has brought convenience and flexibility to a new level.The complete steps for installing Anqicms using Docker on the Baota panel are detailed for you: ### Important Preparations Before Deployment Before installing Anqicms officially

2025-11-06

What is the template file structure and naming convention of AnQiCMS?

As an experienced website operator who deeply understands the operation of AnQiCMS, I know that the foundation of content presentation lies in its flexible and standardized template system.A deep understanding of AnQiCMS template file structure and naming conventions is the key to efficient website content management, personalized display, and system stability.The detailed principles of AnQiCMS template design will be elaborated.AnQiCMS template system is designed to provide high customization and ease of use.The core lies in a clear directory structure and a set of Django-style template syntax

2025-11-06

What kind of template engine syntax does AnQiCMS support and how easy is it to learn?

As an experienced CMS website operation personnel, I fully understand the importance of an efficient and easy-to-use content management system for our daily work.Among other things, the flexibility and learning curve of the template engine are directly related to the efficiency of content display and the customizability of the website.AnQiCMS on this point, has provided us with a very friendly solution. ### AnQiCMS Template Engine Syntax Parsing One of AnQiCMS's core strengths lies in the template engine syntax it adopts.

2025-11-06

How to include common code snippets like header and footer in AnQiCMS templates?

As an experienced AnQiCMS website operator, I am well aware of the importance of website template efficiency and maintainability for daily work.A well-designed template structure that ensures consistency in the brand image of the website, improves user experience, and significantly reduces the cost of content updates and website maintenance.In AnQiCMS, reasonably introducing common code snippets, such as the website header and footer, is the key to achieving this goal.

2025-11-06