As an experienced website operator, I am very familiar with the powerful functions of AnQiCMS and its application in enterprise content management.Today, I will guide you on how to set up reverse proxy for your AnQiCMS Docker version under the Baota panel environment, ensuring that your website runs efficiently and securely, and laying a foundation for future multi-site expansion.

Guidelines for setting up the AntQi CMS Docker version of Baota Panel reverse proxy

AnQiCMS is a modern content management system developed based on the Go language, which is favored by many small and medium-sized enterprises and content operation teams for its lightweight, efficient, and scalable features.When you choose to deploy AnQiCMS through Docker containerization, combined with the powerful visual management capabilities of Baota panel, it can greatly simplify O&M work.Among them, setting up a reverse proxy is a critical step to ensure that the website can be accessed normally through the domain name.

Preparation and environmental confirmation

Before starting to set up the reverse proxy, make sure that your server has already installed Baota Panel and that the panel version is above 9.2.0 (recommended 9.5.0 or higher), and that the Docker service has also been successfully installed and running in Baota Panel.You should have already followed the AnQiCMS Docker version installation tutorial, successfully deployed AnQiCMS in the Baota panel Docker container, and set its default container port to 8001 (or any other port you customize).Generally, the first installation of AnQiCMS Docker version will be set to default inhttp://127.0.0.1:8001Provide services.

Add a reverse proxy site in Baota Panel

First, log in to your Baota panel. In the left navigation menu, find and click the "Website" option.After entering the website management interface, you will see several tabs at the top. Please switch to the 'Reverse Proxy' tab.Click the "Add Reverse Proxy" button here to start creating a new reverse proxy site.

In the pop-up "Add Reverse Proxy" configuration interface, you need to fill in the following key information:

  • Domain: Here you need to enter the domain name you want to use to access the AnQiCMS website, for example:test.anqicms.comMake sure that the domain name has been correctly resolved to your server IP address.
  • Target URLThis is the internal address pointing to your AnQiCMS Docker container service. By default, if your AnQiCMS Docker container is running on port 8001, then you should fill inhttp://127.0.0.1:8001. If you set a different port when creating a Docker container, please make sure to use your actual port number. For example, if the container port is 8002, enter it here.http://127.0.0.1:8002.

After filling in, click the "OK" button to complete the creation of the reverse proxy site.At this time, the Baota panel will automatically configure the reverse proxy rules of Nginx (or Apache, depending on your server environment) to forward external domain requests to the AnQiCMS Docker container running internally.

Use your AnQiCMS website

After the reverse proxy is set up, you can enter the domain name you just set in your browser (for examplehttp://test.anqicms.com/Visit your AnQiCMS website. If it's your first visit, the system will guide you to the initial installation interface, complete the database configuration, and set up the administrator account.

The backend management address of AnQiCMS is usually your domain name plus/system/the path. For example, if your website domain ishttp://test.anqicms.com/Then the background address ishttp://test.anqicms.com/system/Make sure to change the default administrator account and password in time to ensure website security.

Expansion: How to add multiple sites to Anqicms.

AnQiCMS supports multi-site management, through reverse proxy, you can deploy multiple independent AnQiCMS sites on the same server.

1. Add a new reverse proxy site in the Baota panel:

Repeat the steps of adding a reverse proxy site in the Baota panel as mentioned above.Configure a separate domain for each new AnQiCMS site and point it to the default 8001 port (or the container port you used when deploying) of your AnQiCMS Docker version.This means that all external requests will first reach the same AnQiCMS Docker container and then be routed internally by AnQiCMS.

2. Add a new site in the AnQiCMS backend:

Successfully set up the new reverse proxy and log in to the main site backend of your AnQiCMS Docker version.Find and click the "Multi-site Management" feature in the left menu, then select "Add New Site".

In the "Add new site" interface, pay attention to the following points:

  • Site name: Fill in the actual use of the new site to distinguish it.
  • Site root directoryDue to AnQiCMS running within a Docker container, its file system path is different from the host. Therefore, the site root directory is usually set to/app/Start followed by a unique directory name generated based on a new domain name, for example/app/dev_anqicms_com(Replace the dots in the domain with underscores). This directory is used to store independent data such as cache, configuration files for new sites, and ensures data isolation for each site.
  • website address: Enter the complete domain name of the new site, for examplehttp://dev.anqicms.com.
  • Administrator account password: Set up independent backend administration account and password for new site.
  • Database nameSimilarly, provide an independent database name for the new site, for exampledev_anqicms_com.
  • Duplicate database informationDue to your AnQiCMS being deployed with Docker and connected to the MySQL container, you can usually directly select 'Reuse default database account information' because your AnQiCMS container has permission to access the MySQL service.
  • Select the template to use: Choose an appropriate template for the new site.

After filling in all the information, click the "OK" button, AnQiCMS will automatically create and configure a new site for you. Now, you can access the back end through the "Visit Back End" button in the multi-site management list, or directly enter the domain name of the new site in the browser/system/Manage and use this new site.

By following these steps, you have not only set up reverse proxy for your AnQiCMS Docker version, but also learned how to flexibly manage and expand multiple AnQiCMS sites under the Baota panel.Hope this detailed guide can help you better operate your website!


Frequently Asked Questions

Q1: After setting up reverse proxy, why does accessing the domain name result in a 502 Bad Gateway error?

A1: 502 error usually indicates that the reverse proxy server (Nginx/Apache) is unable to obtain a response from the backend service (AnQiCMS Docker container).This is the most common reason, it is due to the incorrect filling of the "Target URL" in the reverse proxy settings of the Baota panel, for example, the port number does not match the port of the AnQiCMS Docker container actually running, or the AnQiCMS Docker container itself is not running properly.Please log in to the Baota panel, check the status of the Docker service and AnQiCMS container, and verify that the IP address and port in the reverse proxy target URL match the port exposed by the AnQiCMS container.In addition, the firewall of the server may also block access to internal ports, please ensure that the relevant ports are open to the outside.

Q2: My AnQiCMS Docker container is running on a non-default port 8001. How should I fill in the reverse proxy settings on Baota panel?

A2: If your AnQiCMS Docker container is not running on the default port 8001, for example, if you specified port 8002 when creating Docker.Then in the "Add Reverse Proxy" section of the Baota panel, you need to change the port number to the actual container port.For example, fill inhttp://127.0.0.1:8002.127.0.0.1Is a local loopback address, ensures that the request is forwarded to the correct container port internally.

Q3: I want to deploy multiple AnQiCMS sites on the same server, each with a different domain, but they all point to the same AnQiCMS Docker container.Can this be?

A3: Yes, absolutely. The powerful multi-site management function of AnQiCMS is designed for this purpose.You just need to add reverse proxy for each new domain separately in the Baota panel, and make sure they all point to the internal IP and port of the same AnQiCMS Docker container (for examplehttp://127.0.0.1:8001)。Then, in the AnQiCMS main site backend, add these new sites through the "Multi-site Management" feature, and configure independent domain names, databases, and file directory paths for each new site (for example,/app/your_new_domain_com)。AnQiCMS will automatically route to the corresponding site content based on the visited domain.