Dear website operation peers, hello! As a seasoned veteran in content operation for many years, and also a loyal user and in-depth 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.AnQi CMS, with its high-performance architecture in Go language and excellent multi-site management capabilities, is exactly the tool we need to meet these challenges.

Today, I will combine my experience in deploying multiple sites of Anqin CMS using 1Panel to 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.

AnQi CMS Multi-Site Architecture Overview

Firstly, we need to understand the multi-site working principle of Anq CMS. Unlike some traditional CMS, Anq CMS is designed with a simple and efficient system architecture, allowing you toAn individual secure 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.

Under Docker, this is reflected in the fact that we only need to deploy a secure CMS Docker container. All website requests, regardless of the domain name, will first be received by the reverse proxy server and then forwarded to thisThe same AnQi CMS containerThe AnQi CMS application will automatically identify and render the corresponding website content based on the request headerHostinformation (i.e., the domain name visited by the user).

Deploy the AnQi CMS Docker container (first installation)

Before starting to set up a multi-site reverse proxy, make sure that your server is already installed with the 1Panel management panel, and that OpenResty (as a reverse proxy server) and MySQL (or another database of your choice) are installed in the 1Panel app store.

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

Select 'Container' in 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 recognizable name for the container, for example,anqicms-main. In the mirror configuration part, select "Enter manually", then enter in the input boxanqicms/anqicms:latest. Port mapping is a critical step. In the "Exposed Port" area, fill in both the "Server Port" and "Container Port".8001. Please note, this8001Is the port that AnQi CMS listens to inside the Docker container, and all external reverse proxies will point to this port. Continue scrolling down, in the "Reboot Strategy" section, select "Reboot after failure" or "Reboot if not manually stopped", to ensure container stability.Finally, click “Confirm” to complete the creation of the container.

After the container is successfully created, you need to set up a reverse proxy for your main site and complete the initial installation of the Aq Enterprise CMS through this domain. For example, the domain name of your main site ismain.anqicms.com, you will create a reverse proxy in the "Website" feature of 1Panel, tomain.anqicms.comproxy to127.0.0.1:8001. After completing the initial installation of AnQi CMS (fill in database information, admin account password, etc.), your main site can be used normally, and you will be able to manage other sub-sites through its admin panel.

configure reverse proxy for the AnQi CMS multi-site

Now, we already have a running Anqie 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.

Select 'Website' from the left menu of the 1Panel panel, then click the 'Website' tab, and click the 'Create Website' button.In the pop-up interface, select "Reverse Proxy". In the "Primary Domain" field, enter your first sub-site domain name, for example: site1.anqicms.com. In the "Proxy Address" field,enter the internal address and port of the AnQi CMS Docker container, that is127.0.0.1:8001. Click "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, fill in the "main domain".site2.anqicms.comAnd the "proxy address" still points to.The same AnQi CMS Docker container.:127.0.0.1:8001.

Remember, no matter how many secure CMS sub-sites you have, when creating reverse proxies for them in 1Panel, the 'proxy address' should point to the one you deployed.The only secure CMS Docker containerInternal IP and port (usually127.0.0.1:8001).1Panel's OpenResty (Nginx) automatically handles the mapping of domain names to backend services and passes the correctHostheader to the Anqic CMS container.

Add a new site in the Anqi CMS backend

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

Log in to yourmain sitefor examplemain.anqicms.com/system/The Aiqi CMS backend. Find and click the "Multi-site management" feature in the left menu.Click the "Add new site" button. Fill in the form according to the actual situation of the new site:

  • Site name: Enter a recognizable name, such as "My first sub-site".
  • Site root directoryThis item is very important. Since AnQi CMS runs in a Docker container, it needs a separate directory to store each site's cache, configuration files, and other data.Recommend using AnQi CMS to/app/Start by adding your new site domain (replace the dots in the domain with underscores). For example, if your new site domain issite1.anqicms.com, then fill in/app/site1_anqicms_comMake sure that the root directory name for each site is unique.
  • website addressEnter the complete access URL of the new site, for examplehttp://site1.anqicms.com.
  • Administrator account password: Set up independent backend administration account and password for new site.
  • Database name: Create an independent database for the new site. It is also recommended to use the site domain (dots replaced by underscores) as the database name, for examplesite1_anqicms_com.
  • Duplicate database informationIf 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 them in manually.
  • Select the template to use: Select a default template for the new site.

Click the “OK” button to complete the creation of the new site after filling in.

Verify and use the new site

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

You can access the management interface of the new site directly by clicking the "Access Backend" button next to the new site in the "Multi-site Management" list on the AnQi CMS backend. Or, you can also directly enter the domain name of the new site in the browser, such ashttp://site1.anqicms.com/Then proceedhttp://site1.anqicms.com/system/Access its backend.

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


Frequently Asked Questions (FAQ)

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

This is the core feature of the AnQi CMS multi-site management design.AnQi CMS as a high-performance Go language application, its internal implementation has the ability to distribute different site content according to the request domain.When all external domains forward requests to the same Aanqi CMS container port (for example8001At this time, the reverse proxy server will retain the original request'sHostThe (which is the domain name accessed by the user). The Anqi CMS container will read this after receiving the request.HostHead, and according to the website address you have configured in the "Multi-site Management" background of Anqi CMS, accurately load and render the content and data of the corresponding site.This centralized service model greatly simplifies deployment and operation.

2. Can I deploy a separate Docker container for each Anqi CMS sub-site and have them listen on different ports?

Yes, this is another way to deploy multi-site, but it is suitable if you want each site to haveTotally independent, mutually unaffected Safe CMS instancesThe scenario. If you choose this method, you will need to create an independent Docker container for each safe CMS application in 1Panel, with each container listening on a different port (for example, 8001, 8002, 8003, etc.).Then, when creating reverse proxies for each domain name in 1Panel,代理地址Point to an independent port for the corresponding Docker container (for example,site1.comProxy