As an experienced website operator, I am very familiar with the powerful functions of AnQiCMS and its application in corporate 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 your website runs efficiently and securely, and lays the foundation for future multi-site expansion.
English CMS Docker version Baota panel reverse proxy setup guide
AnQiCMS as an modern content management system developed based on Go language, with its lightweight, efficient and scalable features, has been favored by many small and medium-sized enterprises and content operation teams.When you choose to deploy AnQiCMS through Docker containerization, combined with the powerful visual management capabilities of Baota panel, it can greatly simplify the operation and maintenance work.Among them, setting up reverse proxy is a critical step to ensure that the website can be accessed normally through the domain name.
Preparation and environment confirmation
Before setting up the reverse proxy, please ensure that your server has already installed Baota Panel and that the panel version is 9.2.0 or higher (recommended 9.5.0 or higher), as well as that the Docker service has been successfully installed and running in Baota Panel.You should have already successfully deployed AnQiCMS according to the installation tutorial of AnQiCMS Docker version, in the Docker container of Baota panel, and set the default container port to 8001 (or any other port you customized).http://127.0.0.1:8001Provide services.
Add a reverse proxy site in the Baota panel.
Firstly, log in to your Baota panel.In the left navigation menu, find and click the "Website" option.Enter the website management interface, and you will see several tabs at the top. Please switch to the 'Reverse Proxy' tab.Here, click the "Add Reverse Proxy" button 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: Enter the domain name you want to use to access the AnQiCMS website here, for example:
test.anqicms.comPlease ensure that the domain name is 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 in
http://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.
Completed 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 for Nginx (or Apache, depending on your server environment) for you, forwarding 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 the browser (for examplehttp://test.anqicms.com/)来访问您的AnQiCMS网站了。如果是首次访问,系统会引导您进入初始化安装界面,完成数据库配置和管理员账号设置。
AnQiCMS的后台管理地址通常是您的域名加上English/system/路径。例如,如果您的网站域名是Englishhttp://test.anqicms.com/Then the backend address ishttp://test.anqicms.com/system/Please make sure to change the default administrator account and password in time to ensure website security.
Expansion: How to add multiple sites for Anqi CMS
AnQiCMS supports multi-site management, and you can deploy multiple independent AnQiCMS sites on the same server through reverse proxy.
1. In the Baota panel, add a new reverse proxy site:
Translate the steps above "Add Reverse Proxy Site in Baota Panel".Configure a separate domain for each new AnQiCMS site and point it to your default AnQiCMS Docker port 8001 (or the container port you used when deploying).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 background:
Successfully set up the new reverse proxy and log in to the backend of your AnQiCMS Docker version's main site.Find and click on the "Multi-site Management
In the "Add New Site" interface, you need to pay attention to the following points:
- Site NameBased on the actual use of the new site for filling, in order to distinguish.
- Site Root DirectoryEnglish: Since AnQiCMS runs inside a Docker container, its file system path is different from the host. Therefore, the site root directory is usually set to
/app/Start with, followed by a unique directory name generated based on the new domain name, for example/app/dev_anqicms_com(Replace the dots in the domain name with underscores). This directory is used to store the cache, configuration files, and other independent data of the new site, ensuring data isolation for each site. - Website address: Enter the full domain name of the new site, for example
http://dev.anqicms.com. - Administrator account passwordSet up a separate admin account and password for the new site.
- Database nameSimilarly, provide a separate database name for the new site, for example
dev_anqicms_com. - Database information reuseEnglish translation: Due 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 useSelect an appropriate template for the new site.
Fill in all information and click the "Confirm/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.This detailed guide is intended to help you better operate your website!
Frequently Asked Questions
Q1: What could be the reason for a 502 Bad Gateway error after setting up reverse proxy and accessing the domain?
A1: 502 error usually indicates that the reverse proxy server (Nginx/Apache) cannot obtain a response from the backend service (AnQiCMS Docker container).The most common reason is that you have entered an incorrect "Target URL" in the Baota panel reverse proxy settings, such as the port number not matching the port that the AnQiCMS Docker container is actually running on, or the AnQiCMS Docker container itself is not running normally.Please log in to the Baota panel, check the status of the Docker service and AnQiCMS container to ensure they are normal, and verify that the IP address and port in the reverse proxy target URL match the port exposed by the AnQiCMS container.Moreover, 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, 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 your actual container port.http://127.0.0.1:8002.127.0.0.1Is a local loopback address, ensure that requests are forwarded internally to the correct container port.
Q3: I want to deploy multiple AnQiCMS sites on the same server, each with a different domain name, but they all point to the same AnQiCMS Docker container.Is this okay?
A3:Certainly, absolutely.AnQiCMS powerful multi-site management function is designed for this.http://127.0.0.1:8001)。Then, add these new sites through the "Multi-site Management" feature in the AnQiCMS main site's backend, 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.