Hello, all website operation colleagues!As an experienced veteran in content operation for many years, and also a loyal user and deep practitioner of AnQi CMS, I know that in the increasingly fierce market competition, efficient content management and flexible multi-site deployment are crucial for attracting and retaining users.English CMS with its high-performance architecture in Go language and excellent multi-site management capabilities is the weapon we use to face these challenges.

Today, I will share my experience in deploying multiple sites of AQ CMS using 1Panel, and give you a detailed explanation of how to correctly set up reverse proxy in the 1Panel environment to achieve efficient and stable multi-site operation.

English CMS multi-site architecture overview

Firstly, we need to understand the multi-site working principle of AnQi CMS. Unlike some traditional CMS systems, AnQi CMS is designed with a simple and efficient system architecture that allows you toSingle security CMS application instanceManage multiple independent websites.This means that, no matter how many brand websites, sub-sites, or content branches you have, you do not need to deploy a complete security CMS code and database for each site.This design greatly reduces resource consumption and operational complexity.

In the Docker environment, this is reflected in the fact that we only need to deploy a Docker container for an enterprise CMS. All website requests, regardless of the domain name, will first be received by the reverse proxy server and then forwarded to thisThe same security CMS container. The security CMS application will identify and render the corresponding website content according to the request headerHostinformation (i.e., the domain name visited by the user), automatically.

Deploying the Auto CMS Docker container (first installation)

Before starting to set up multi-site reverse proxy, please ensure that your server has already installed the 1Panel management panel, and has installed OpenResty (as a reverse proxy server) and MySQL (or any other database you choose) in the 1Panel app store.

Firstly, we need to deploy the Docker container of the Security CMS in the 1Panel. This step is the foundation for all subsequent multi-site settings.

Select "Container" from the left menu of the 1Panel panel, then click the "Container" tab, and click the "Create Container" button. In the pop-up window, enter a name for the container that is easy to recognize, such asanqicms-mainIn the mirror configuration section, select "Manual input", and then enteranqicms/anqicms:latest。 Port forwarding is a critical step. In the "Exposed Ports" area, both the "Server Port" and "Container Port" should be filled in8001。Please note, this8001Is the port that AnQin CMS listens to inside the Docker container, and all external reverse proxies will point to this port. Keep scrolling down, select "Restart policy" and choose "Restart on failure" or "Restart if not manually stopped" to ensure container stability. Finally, click "Confirm" to complete the container creation.

After the container is created, you need to set up a reverse proxy for your main site and complete the initialization installation of the CMS through this domain name. For example, the domain name of your main site ismain.anqicms.com,you will create a reverse proxy in the 'Website' feature of 1Panel.main.anqicms.comproxy to127.0.0.1:8001.Complete the initialization installation of the security CMS (fill in database information, administrator account password, etc.), and your main site will be able to be used normally, and you will be able to manage other child sites through its backend.

configure reverse proxy for multiple sites of AnQi CMS

Now, we already have a running security CMS Docker container and have completed the initialization of the main site.Next, we will set up reverse proxy for other sub-sites that need to be deployed.

Assuming you plan to deploy two new sites, the domain names aresite1.anqicms.comandsite2.anqicms.com.

In the 1Panel panel, select "Website" from the left menu, then click the "Website" tab, and click the "Create Website" button.In the popped-up interface, select "Reverse Proxy".site1.anqicms.com. In the "Proxy Address" field,fill in the internal address and port of the Anqi CMS Docker container, which is127.0.0.1:8001Click "Confirm" to complete the reverse proxy setup for the first sub-site.

Repeat the above steps for your second sub-site.site2.anqicms.comCreate another reverse proxy. Similarly, enter the “primary domain name”site2.anqicms.com, and the “proxy address” still points tothe same security CMS Docker container:127.0.0.1:8001.

Please remember, regardless of how many security CMS sub-sites you have, when creating reverse proxies for them in 1Panel, the 'proxy address' should point to the one you have deployed.The only one secure CMS Docker containerThe internal IP and port (usually)127.0.0.1:8001)。1Panel的OpenResty(Nginx)会自动处理域名与后端服务的映射,并将正确的头传递给安企CMS容器。Host头传递给安企CMS容器。

Add a new site in AnQi CMS backend

After setting up reverse proxy for all domains in 1Panel, the next step is to go to the AnQi CMS backend to add the site actually.

Log in to yourmain site[for example]main.anqicms.com/system/The English translation of 'auto' is 'English'. The original value is ')的安企CMS后台。'Find and click the "Multi-site Management" feature in the left menu.Click the "Add New Site" button.

  • Site Name: Enter a name that is easy to identify, for example, "My First Subsite".
  • Site Root DirectoryThis item is very important.Since the AnQi CMS runs inside a Docker container, it requires a separate directory to store each site's cache, configuration files, and other data./app/Start with, then add your new site domain (replace the dots in the domain with underscores). For example, if your new site domain issite1.anqicms.com,then enter/app/site1_anqicms_comPlease ensure that the root directory name of each site is unique.
  • Website address: Enter the complete access URL of the new site, for examplehttp://site1.anqicms.com.
  • Administrator account passwordSet up a separate admin account and password for the new site.
  • Database nameCreate a separate database for the new site. To avoid conflicts, it is also recommended to use the site domain name (dots replaced with underscores) as the database name, for examplesite1_anqicms_com.
  • Database information reuseIf you use the default database account information when installing AnQi CMS in Docker, you can usually directly select 'Reuse default database account information'.If you have specific database configuration requirements, you can fill it in manually.
  • Select the template to useSelect a default template for the new site.

After filling in, click the “OK” button to complete the creation of the new site.

Verify and use the new site

After completing all the steps, your new site has been successfully deployed.

You can access the "Multi-site Managementhttp://site1.anqicms.com/and then throughhttp://site1.anqicms.com/system/Access its backend.

By this method, you can easily deploy and manage multiple independent content sites under a single 1Panel environment and a single security CMS Docker container, greatly improving operational efficiency and resource utilization.


Common Questions and Answers (FAQ)

1. Why do all the security CMS sub-sites in the 1Panel reverse proxy point to the same127.0.0.1:8001port?

This is the core feature of the security CMS multi-site management design.AnQi CMS is a high-performance Go language application that internally implements the ability to distribute different site content based on the request domain.8001), the reverse proxy server will preserve the original request'sHostThe head (i.e., the domain name accessed by the user). The security CMS container will read this after receiving the request.HostHead, and accurately load and render the corresponding site content and data according to the website address you configure in the "Multi-site Management" background of AnQi CMS.This centralized service model greatly simplifies deployment and operation.

2. Can I deploy an independent Docker container for each security CMS sub-site and have them listen on different ports?

Yes, this is another way to deploy multiple sites, but it is suitable for when you want each site to haveentirely independent and mutually unaffected CMS instancesEnglish的场景。If you choose this method, you need to create a separate Docker container for each security CMS application in 1Panel, so that they listen to different container ports (such as 8001, 8002, 8003, etc.).代理地址指向对应Docker容器的独立端口(例如,site1.com代理