How to configure Docker reverse proxy to display multiple independent websites for AnQiCMS multi-site feature?

Calendar 👁️ 77

AnQiCMS (AnQiCMS) is favored by many website operators for its efficient and flexible content management capabilities.Especially its powerful multi-site management function, combined with Docker containerization technology and reverse proxy, allows you to easily set up and manage multiple independent websites on the same server, greatly enhancing operational efficiency and reducing maintenance costs.

Learn the charm of multi-sites

Imagine that you might have several different brands, targeting different audiences or serving different regions, but they have roughly the same content update and management processes.If each website is deployed independently, not only does it consume a lot of resources, but it is also quite cumbersome to manage.The multi-site feature of AnQiCMS is exactly to solve this pain point.

It allows you to create multiple independent websites within an AnQiCMS system instance, each with its own domain, content, template, and even management team.This means, you can focus on maintaining an AnQiCMS system while simultaneously operating multiple seemingly independent websites.This unified management approach greatly reduces redundant work, optimizes resource allocation, and makes cross-site data sharing and resource integration extremely convenient.Whether it is to expand new business lines or to promote content in multiple languages and regions, AnQiCMS' multi-site capabilities can provide solid support.

Docker and reverse proxy: a golden partner

To fully leverage the advantages of AnQiCMS multi-site, Docker and reverse proxy are indispensable 'golden partners'.

first, DockerContainer technology has brought unprecedented convenience to the deployment of AnQiCMS.It packages AnQiCMS and all its dependencies into a lightweight, portable container, achieving isolation between the application and the runtime environment.This means that no matter what your server environment is, AnQiCMS can run consistently and avoid complex environment configuration issues.Build once, run anywhere, making deployment and upgrades extremely simple and secure.For multi-site scenarios, simply starting an AnQiCMS Docker container enables it to serve multiple websites.

secondly,Reverse ProxyHere, he acts as a 'traffic guide'. Without a reverse proxy, if a Docker container only exposes one port (such as the default 8001 port of AnQiCMS), then all external requests can only access the same service through this port.However, when you have multiple domains (such assite1.com/site2.comWhen that happens, you need a reverse proxy to route traffic to the correct backend service based on different domain names.In our scenario, all different domain names are received by the reverse proxy server, which then intelligently forwards these requests to the same AnQiCMS Docker container. AnQiCMS then identifies and displays the corresponding independent website content based on the domain name of the request.This effectively resolves the port conflict issue and allows you to use the standard 80 or 443 ports for each website.

Configuration steps: Make multiple websites run

Now, let's go step by step to see how to make the multi-site function of AnQiCMS truly work through Docker and reverse proxy.We take the common Baota panel as an example, as it integrates Docker management and reverse proxy configuration, making the operation relatively intuitive.

First step: Preparation - Docker environment and MySQL

Before you start, please make sure that the Baota panel is installed on your server and that the Docker service within the panel is running.At the same time, since AnQiCMS requires database support, please install a MySQL container in the Docker App Store.Please note the password for the root user when installing MySQL, as it will be used later when installing AnQiCMS.If your server memory configuration is not high, it is recommended to choose MySQL 5.6 version to reduce resource consumption.

Second step: Deploy the first AnQiCMS instance

Next, deploy your first AnQiCMS instance through the Docker container feature of the Baota panel.

  1. Enter the "Docker" interface of the Baota panel, select the "Container" tab, and click "Create Container".
  2. Enter container information:
    • Name:can beanqicms-mainOr any name you like.
    • Image:Manual inputanqicms/anqicms:latest.
    • Port:Select "Expose Port", fill in both the server and container ports.8001(This is the default internal running port of AnQiCMS).If you plan to run multiple AnQiCMS containers on the server (instead of a single container hosting multiple sites), the server ports need to be distinguished.
  3. Set the restart policy to "Restart after failure" or "Restart if not manually stopped", to ensure service stability.
  4. After confirmation, wait for the container to start.

Step 3: Configure reverse proxy for the first website

After the container is running, we need to configure domain access for your first website.

  1. In the left menu of the Baota panel, click "Website" and then click "Create Website".
  2. Select the "Reverse Proxy" type.
  3. Primary Domain:Enter your first website domain name, for examplemain.yourdomain.com.
  4. Proxy Address:Fill inhttps://en.anqicms.com. Here127.0.0.1Point to your server locally,8001Is the port exposed by the AnQiCMS Docker container.
  5. Click confirm to complete the creation of the site. Now, visit your domain and you should see the AnQiCMS initial installation interface.Follow the instructions to complete the database configuration and set up the administrator account.Database information please use the root password of the MySQL container you installed in the first step.

Step 4: Add a new site inside AnQiCMS

After the first website is installed, log in to its backend. This is the core: we will create more websites in an AnQiCMS instance.

  1. In the AnQiCMS backend left menu, find the 'Multi-site Management' feature, click 'Add New Site'.
  2. In the pop-up interface, fill in the following information carefully:
    • Site Name:The name of the new website.
    • Site root directory: Very important!This is a directory independent of other sites, used to store cache and other data for the new website. Please use/app/Start by adding your domain name (replace dots with underscores), for example/app/dev_anqicms_comMake sure this directory name is unique.
    • Website address:For example, the complete domain name of your new website,http://dev.anqicms.com.
    • Admin account password:Set up a separate admin account and password for this new website.
    • Database name: Very important as well!A new website needs an independent database to store its content. It is recommended to name it with your domain (replacing dots with underscores), for exampledev_anqicms_com.
    • **Database Information

Related articles

How to automatically convert URLs to clickable links in AnQiCMS templates using the `urlize` filter?

In website content management, we often need to display external links in articles, comments, or introductions.Manually adding the `<a>` tag to each URL is not only cumbersome but also prone to errors, especially when dealing with large amounts of user-generated content or importing data from other sources.Fortunately, AnQiCMS provides a very practical template filter——`urlize`, which can automatically identify URLs and email addresses in text and convert them into clickable links, greatly simplifying the work of content managers.

2025-11-07

How to set the website logo and filing number of AnQiCMS so that it can be displayed correctly on the front-end page?

During the process of building a website, the brand identity (Logo) and the necessary compliance information (record number) are indispensable elements.They can not only enhance the professionalism and credibility of the website, but also provide clear guidance to users.AnQiCMS is an efficient content management system that provides an intuitive and convenient way to set these information and ensures that they are displayed correctly on the website front-end page. Next, we will learn how to set the website logo and filing number in AnQiCMS in detail.

2025-11-07

How to display user details such as avatar and username in AnQiCMS templates?

In AnQiCMS, flexibly displaying users' detailed information in templates, such as avatars and usernames, is an important step to achieve personalization and enhance website interaction.AnQiCMS's powerful template engine provides an intuitive and efficient way to integrate these data. ### Understanding the Data Calling Mechanism of AnQiCMS Template AnQiCMS template system uses a syntax style similar to Django, which makes template writing both intuitive and powerful.The essence lies in using specific template tags to call back-end data.

2025-11-07

How to correctly display the link and title of the previous/next document in AnQiCMS template?

How to elegantly display the link and title of the previous/next document in the AnQiCMS template?When browsing articles on a website, users often want to easily navigate to related content, whether it's going back to the previous one for a deeper understanding or continuing to read the next new content.This "Previous/Next" navigation feature not only significantly improves user experience and extends the time users spend on the website, but also benefits the internal link structure and SEO optimization of the website.

2025-11-07

How to manage custom fields in the content model of AnQiCMS and call them to display on the front-end page?

AnQi CMS is an efficient and customizable enterprise-level content management system, one of its core highlights is the 'flexible content model'.This feature greatly expands the management boundaries of website content, allowing us to create various and unique content structures according to actual business needs.Among these, custom fields (or custom parameters) play a crucial role, allowing our website content to go beyond traditional article titles, body, and summaries, and carry more personalized information, ultimately displaying flexibly on the front-end page.

2025-11-07

How to customize templates in AnQiCMS to change the overall visual style and layout of the website?

In this era that emphasizes brand and user experience, the visual style and layout of a website is the key to its successful operation.AnQiCMS (AnQiCMS) understands this point and therefore provides a highly flexible template customization feature, allowing users without a strong development background to create websites that meet their unique needs with a personalized touch.If you are considering changing the overall style of the website or want to design a dedicated layout for specific content, it will be very helpful to understand how to customize templates in AnQiCMS.

2025-11-07

Where should the AnQiCMS template files be stored, and what file extensions are supported?

AnQiCMS is designed very clearly and flexibly in template file management, aiming to allow users to customize the appearance and functions of the website efficiently.If you are using AnQiCMS to build or maintain a website, understanding the location of template files and supported suffixes is the foundation for front-end development and customization.

2025-11-07

How to use Django template engine syntax to efficiently display various dynamic content in AnQiCMS?

In AnQi CMS, you will find that the built-in Django template engine syntax is an extremely powerful and flexible tool, which can help you efficiently convert backend data into dynamic and lively content on the frontend page.Master this syntax, and you'll not only be able to display basic text and images, but also build complex, interactive dynamic pages, making your website vibrant.The template syntax design of Anqi CMS is very intuitive, it draws on the characteristics of the Django template engine and integrates the concise and efficient Go language.

2025-11-07