How to deploy AnQiCMS multi-site in Docker environment and configure reverse proxy?

Calendar 👁️ 56

As an experienced CMS website operator, I am well aware of the importance of an efficient and flexible content management system for enterprises and self-media in the increasingly complex network environment.AnQi CMS, with its high-performance architecture based on the Go language, rich feature set, and SEO-friendliness, has become the ideal choice for many users.Especially in multi-site management, AnQiCMS provides a simple and efficient solution.

Today, I will delve into how to deploy multiple sites of AnQi CMS in a Docker environment and configure reverse proxy, which not only enhances the convenience of deployment but also provides strong support for your multi-site operation.

Embrace Docker, build an efficient and stable secure CMS multi-site environment

AnQi CMS is positioned to serve small and medium-sized enterprises and content operation teams, one of its core advantages is the powerful multi-site management capability, which can allow you to manage multiple brands, sub-sites, or content branches uniformly, greatly reducing repetitive work.When we combine this advantage with Docker containerization technology, deployment and management will become unprecedentedly efficient and flexible.Docker provides a lightweight, portable, and self-contained runtime environment, ensuring that CMS can run consistently anywhere and simplifying dependency management and environment configuration.For users who need to operate multiple sites, Docker's isolation, scalability, and ease of maintenance are undoubtedly the key to building a stable and high-performance website cluster.

Deploy the first secure CMS site container

The first step to deploy AnQi CMS in Docker environment is to establish a basic containerized runtime environment and configure reverse proxy for your main site.Here, we will take mainstream panel tools as examples, such as 1Panel or Baota panel, which integrate Docker management functions and greatly simplify the operation process.

First, make sure that Docker is installed on your server, and to store QiCMS data, you also need to install a MySQL database service through the panel app store.If installed via 1Panel, please select OpenResty as the reverse proxy server in the app store.

Next, we need to create a container for the Safe CMS in Docker. In the container management interface of the panel, select Create Container. Name the container, for exampleanqicms-main. Manually enter in the mirror selectionanqicms/anqicms:latestto obtain the latest stable version of the AnQi CMS mirror. The key step is port configuration: set the container's internal port to8001And expose it to an available port on the server, for example, the same is8001This port is the only interface for the Anqi CMS application to provide external services. After the container is created, set an appropriate restart strategy to ensure high availability of the service.

After the container is successfully started, the next step is to configure the reverse proxy to forward external domain requests to the AnQiCMS container.In the panel's website management feature, create a new reverse proxy site.Enter your primary domain name, for exampleyourmaindomain.comSet the proxy address to the local IP and port of the Docker container, usually127.0.0.1:8001The reverse proxy not only implements port mapping, but also allows you to access multiple sites through different domain names on the same server, and can handle advanced features such as SSL certificates, traffic distribution, etc.After the configuration is complete, visit your main domain name, follow the AnQiCMS guide to complete the initial installation, including database connection and administrator account settings.

Expand multi-site management: The powerful charm of Anqi CMS

The strength of AnQi CMS lies in its built-in multi-site management feature, which means you do not need to deploy an AnQi CMS container separately for each site.A AnQiCMS Docker container is enough to manage hundreds or even thousands of independent sites.This design concept greatly saves server resources and simplifies the complexity of operations and maintenance, perfectly fitting the project positioning of AnQiCMS 'uniformly manage different content sites'.

To add a new site to an existing AnQi CMS instance, first log in to the backend of the AnQiCMS main site you have installed.Find the "Multi-site Management" feature in the left navigation menu and click "Add New Site".Here, you need to configure several key information for the new site:

  • Site name: Used for distinguishing friendly names in the background.
  • Site root directory: This is the independent storage path for the new site data. Because AnQiCMS runs in a Docker container./app/Under the directory, therefore it should start with/app/and use the domain name (dots replaced with underscores) as the subdirectory name, for example/app/dev_anqicms_comEnsure that each site's directory name is unique to avoid data conflicts.
  • website address: The full domain name of the new site, for examplehttp://dev.anqicms.com.
  • Administrator account password: Set up an independent backend management account for the new site.
  • Database name: Specify a unique database name for the new site, it is also recommended to use the domain name (dots replaced with underscores) as a prefix, for exampledev_anqicms_com. An QiCMS supports reusing the Docker MySQL account information, no additional database credentials need to be configured.
  • Select the template to use: Choose an appropriate template based on your design requirements.

After completing these configurations and clicking confirm, AnQiCMS will create all necessary data structures and configuration files for the new site within its internal system.

Configure reverse proxy for the newly added site

After adding a new site in the AnQiCMS background, although AnQiCMS has already 'recognized' this new site, external users still cannot access it.You need to configure a separate domain and reverse proxy rules for each new site on the server panel.

Go back to your server management panel (such as 1Panel or Baota panel) website management interface, click on "Create website" or "Add reverse proxy" again. Enter the domain name of the new site, for exampledev.anqicms.comPlease note that the proxy address of this new site must still point to the exposed port of your unique AnQiCMS Docker container, i.e.127.0.0.1:8001This is because AnQiCMS internally uses theHostHeader information (i.e., the domain name accessed by the user) to determine which site the request belongs to and to provide the corresponding content.Each reverse proxy will forward requests for specific domain names to the same AnQiCMS container, and the container will then identify the corresponding AnQiCMS sub-site based on the domain name.

Repeat the above steps to configure reverse proxy for each of your new sites.Once configured, you can access each independent AnQiCMS sub-site through its corresponding domain.In the "Multi-site Management" list of the AnQiCMS backend, you can conveniently click the "Access Backend" button to directly jump to the management interface of the corresponding site.

key configuration and **practice

When deploying Anqi CMS multi-site and configuring reverse proxy, there are several**practices worth your attention, which will directly affect the performance, security, and maintainability of your website:

  • Domain resolution: Make sure that all domain names of the sites are correctly resolved to your server IP address before configuring the reverse proxy. This is the foundation for all external access.
  • Resource planning: Even a Docker container can host multiple AnQiCMS sites, but you also need to reasonably plan the server's CPU, memory, and storage resources based on your expected traffic and number of sites.The high concurrency features of the Go language make AnQiCMS excellent in resource utilization, but too many high-traffic sites may still put pressure on the server.
  • Database isolation: Although multiple AnQiCMS sites can share a single MySQL database service, it is strongly recommended to configure an independent database instance for each site.This can effectively isolate data from different sites, prevent cross-contamination, and facilitate future data backup, recovery, and migration.
  • Enhanced Security: AnQiCMS provides a custom backend domain feature, you can set an independent access address for the backend of each site to enhance security.At the same time, be sure to use a complex and unique administrator password and update it regularly.
  • SEO optimization: AQiCMS built-in powerful SEO tools, such as pseudo-static, 301 redirection, Sitemap generation, Robots.txt configuration, keyword library management, etc.In a multi-site environment, make sure to configure and optimize these SEO settings independently for each site to maximize the search engine visibility of each site.

By deploying your applications in Docker containers and leveraging the powerful multi-site management features of AnQi CMS, you will be able to operate your website cluster with high efficiency and flexibility, whether it is for content marketing of small and medium-sized enterprises or content distribution of self-media, you will be at ease.

Frequently Asked Questions

Q1: I deployed AnQiCMS in a Docker container and created multiple sub-sites.Why is it always redirected to the main site's admin interface when accessing the backend of one of the child sites?

A1:This is usually due to your reverse proxy configuration not passing through correctlyHostheader information. AnQiCMS detects the information in the request.HostThe field is used to identify which sub-site the user is visiting. Please check your reverse proxy configuration (such as Nginx or OpenResty) to ensure it includesproxy_set_header Host $host;This command. If you are using the panel tool, please confirm that its reverse proxy module is correctly handling this information.

Q2: Can I configure an independent Docker container for each AnQiCMS sub-site?

A2:Although technically feasible, this goes against the design philosophy of the multi-site management built into AnQiCMS and will increase unnecessary resource consumption and management complexity.The multi-site function of AnQiCMS is designed to allow you to manage all sites in a single running instance.Deploying containers individually for each child site will disable the multi-site management feature, you will not be able to manage all sites uniformly in the background of the main site, and it will also consume more CPU, memory, and storage resources.It is recommended that you follow the instructions introduced in the document, and add and manage sub-sites through the multi-site management function of the background of an AnQiCMS container.

Q3: How to ensure that my AnQiCMS multi-site achieves data isolation and high availability in the Docker environment?

A3:For data isolation, when adding a new site in the AnQiCMS background, please configure an independent database name and site root directory for each site.Even though they share the same MySQL Docker container and AnQiCMS Docker container, the data is independent from each other.Regarding high availability, Docker itself provides the container automatic restart function, you can configurerestart: alwaysorrestart: on-failureStrategy. At the same time, you can consider mounting the MySQL database's data directory to the host volume to ensure data persistence and facilitate backup.For more advanced scenarios, you can explore Docker Compose for service orchestration, or use container orchestration tools like Kubernetes to manage and scale your AnQiCMS cluster.

Related articles

How to get the detailed content and images of a single page (such as "About Us")?

Managing and displaying a single page like "About Us" and its content and images in Anqi CMS is an efficient and flexible process.As an experienced website operator, I will explain in detail how to create from the backend to the frontend display, and fully master this feature.--- **To get the detailed content and images of a single page (such as "About Us") in AnQiCMS** AnQiCMS (AnQiCMS) provides a dedicated management module called "Single Page" for independent pages such as "About Us" and "Contact Us"

2025-11-06

How to get all the subcategory lists under a specific category?

As an experienced CMS website operations personnel, I fully understand that flexible management of the website classification system is crucial for content organization and user experience.Especially when your website content becomes richer and the classification structure becomes complex, the ability to accurately and efficiently obtain the list of all subcategories under a specific category is an indispensable ability for template development and content display.AnQi CMS provides a powerful and easy-to-use template tag system, making this operation very simple.Flexiblely obtain the list of all subcategories under the specific category of Anqicms

2025-11-06

How to implement batch replacement of keywords or links in website article content?

As a long-term深耕 website operator who has a deep understanding of AnQiCMS (AnQiCMS), I know that content is the lifeline of the website, and efficient content management is the key to success.In daily operations, we often encounter the need to update keywords or links in a large number of articles on the website, which may be due to brand strategy adjustments, SEO optimization needs, changes in links from external cooperative partners, or even legal and regulatory requirements.Facing thousands of articles, manually modifying one by one is undoubtedly a nightmare that consumes time and effort.It's lucky that

2025-11-06

How to create reusable code snippets (macro functions) in templates?

As an experienced AnQiCMS website operator, I know that efficiency and consistency are very important in daily content management.Especially in template design and content publishing, if code can be effectively reused, it can not only greatly improve work efficiency, but also ensure the consistency of website visual and functional integrity.Today, I will discuss with everyone how to create and utilize reusable code snippets, also known as macro functions, which are one of the key tools for our efficient operation.### Template code reuse

2025-11-06

How to ensure the security of AnQiCMS deployed websites and prevent common security issues?

As a website operator who has dealt with AnQiCMS for many years, I know the importance of website security for content operation.A secure website not only protects user data and maintains the reputation of the enterprise, but is also the foundation for the stable release and dissemination of content.AnQiCMS was designed with security in mind from the outset, and provides a variety of built-in features and practical suggestions to help us build and maintain a secure and stable content platform.AnQi CMS is developed using Go language, which lays a solid foundation for the system's running efficiency and stability

2025-11-06

How to correctly render Markdown formatted content in AnQiCMS templates?

In AnQiCMS templates, correctly rendering Markdown content is a key factor for website operators to enhance content presentation and editing efficiency.Markdown is a lightweight markup language that is favored by content creators for its simplicity, readability, and ease of writing.The AnQiCMS system not only supports the creation of Markdown content but also provides a flexible template rendering mechanism to ensure that this content is presented in the expected way on the front-end page, and can even integrate third-party libraries to display mathematical formulas and flow charts.###

2025-11-06

How to correctly display mathematical formulas and flowcharts in AnQiCMS templates?

In AnQiCMS template, display mathematical formulas and flowcharts correctly As a website administrator focused on content operations, I am well aware of the importance of high-quality content for attracting and retaining users.In some fields, such as education, technology, or scientific research, the content often includes complex mathematical formulas or clear flowcharts.AnQiCMS as a flexible content management system, through the integration of Markdown editor, provides us with the possibility of elegantly presenting these complex elements on the web.Although AnQiCMS itself does not directly render these special contents

2025-11-06

How to achieve unified management of multiple sites in AnQi CMS and improve operational efficiency?

As a website operator who is well-versed in AnQi CMS, I am well aware that in today's complex digital environment, efficiently managing multiple websites has become an urgent need for many enterprises and content operation teams.The traditional single-site management model often struggles when facing scenarios of multi-brand, multi-region, or multi-content branches, leading to low operational efficiency and redundant resource investment.However, AnQi CMS, with its unique design concept and powerful feature set, provides a practical solution for unified management of multiple sites, significantly improving operational efficiency.

2025-11-06