How to manually configure reverse proxy after AnQiCMS Docker deployment fails on aaPanel?

Calendar 👁️ 97

In the daily operation of AnQiCMS, we deeply understand that stable and efficient content release is the cornerstone of success.When you try to deploy AnQiCMS through Docker in the aaPanel environment, you may occasionally encounter a situation where the automated reverse proxy configuration fails.This is usually not a fatal problem, but it requires us to manually intervene and calibrate the configuration to ensure that AnQiCMS can provide normal external services through your domain.

Understand the necessity of reverse proxy

In the Docker environment, AnQiCMS typically runs inside a container and is bound to a specific internal port (such as the default 8001 port). Users cannot access it directly.服务器IP:8001This form of access is not professional, nor is it conducive to SEO, nor can HTTPS be used.The role of reverse proxy is to act as the "gatekeeper" of your domain traffic, it receives all requests sent to your domain through ports 80 or 443 (HTTP/HTTPS) and then forwards these requests to the AnQiCMS container running on internal specific ports, and finally returns the AnQiCMS response to the user.When the one-click deployment of aaPanel's Docker fails to set this step correctly, we need to complete this critical step manually.

Preparation: Confirm the AnQiCMS container status

Before starting to configure the reverse proxy, it is first necessary to confirm that the AnQiCMS Docker container itself is already running.You can log in to the aaPanel panel and navigate to the "Docker" or "Container" management interface to check the status of the AnQiCMS container.If the container is displayed as "Running" and you are sure it is configured to listen on the host's port 8001 (which is the default mapping port for the AnQiCMS Docker image), then we can continue to manually configure the reverse proxy.If the container is not running, you need to check the Docker container's startup issues first.

Manually configure Nginx reverse proxy in aaPanel

As aaPanel usually defaults to using Nginx as the web server, we will first introduce the reverse proxy configuration of Nginx.

First, you need to log in to your aaPanel management interface.Find the 'Website' option in the left navigation bar and click to enter.Here, you may have already created a website for your domain, or you may need to create a new website to host AnQiCMS services.

If the automated deployment fails, it usually means that the existing website configuration is not correctly pointing to the AnQiCMS container.You can edit the website settings of an existing domain or create a new website and select the 'Reverse Proxy' type.In the interface for creating or editing websites, find the settings related to reverse proxy.

The key configuration is in the "target URL" or "proxy address". Here, you need to fill in the port address exposed by the AnQiCMS Docker container on the host, which is usuallyhttps://en.anqicms.com. Here,127.0.0.1It refers to your server's local loopback address, while8001it is the port that the AnQiCMS container is mapped to the host. Make sure that your domain name has been correctly resolved to the server's IP address.

After completing these steps, aaPanel usually automatically generates the Nginx configuration file.To ensure the robustness of the configuration and the normal operation of AnQiCMS, we also need to check or manually modify the Nginx configuration file.In the website settings interface, click the 'Configure' button next to the domain name to enter the Nginx configuration file editing page.

You need to ensure that the configuration file includes the following or similar Nginx reverse proxy rules, which will forward all requests to your domain name to the AnQiCMS container:

location @AnqiCMS {
    proxy_pass https://en.anqicms.com;
    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
}
error_page 404 =200 @AnqiCMS;
location / {
   try_files $uri $uri/index.html @AnqiCMS;
}

The meaning of this configuration is:

  • proxy_pass https://en.anqicms.com;This is the core instruction, telling Nginx to forward requests to the local 8001 port.
  • proxy_set_header Host $host;Pass the original Host request header to AnQiCMS to ensure that AnQiCMS can recognize the correct domain.
  • proxy_set_header X-Real-IP $remote_addr;andproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;These HTTP headers are used to pass the real IP address of the client, which is crucial for logging, security, and IP identification within AnQiCMS.
  • error_page 404 =200 @AnqiCMS;andlocation / { try_files $uri $uri/index.html @AnqiCMS; }These rules ensure that when Nginx cannot find a static file, it will forward the request to AnQiCMS for processing, which is crucial for AnQiCMS's pseudo-static URLs and single-page application (SPA) routing.

After saving the configuration file, be sure to restart the Nginx service in the aaPanel panel to make the new configuration take effect.

Manually configure Apache reverse proxy in aaPanel (if applicable)

If your aaPanel environment is using Apache as the web server, the configuration method will be different. Make sure Apache'smod_proxyandmod_proxy_httpmodule is enabled.

In aaPanel, you need to find the Apache configuration file for the corresponding domain. Usually, it is under the "Website" -> "Your Domain" -> "Configuration" option, select "Apache Configuration" or edit directlyhttpd.conf.

In the configuration file<VirtualHost>block, you need to add the following or similar rules:

ProxyPass / https://en.anqicms.com/
ProxyPassReverse / https://en.anqicms.com/

# 可选:如果AnQiCMS有特定路径需要特殊处理
# <Location /system/>
#     ProxyPass https://en.anqicms.com/system/
#     ProxyPassReverse https://en.anqicms.com/system/
# </Location>
  • ProxyPass / https://en.anqicms.com/: Forward all requests to the root path/to the AnQiCMS container port 8001.
  • ProxyPassReverse / https://en.anqicms.com/Used to adjust the URL in the AnQiCMS response header to ensure that browser redirection or cookie path information is correct, pointing to an external domain rather than an internal IP.

After saving the configuration file, you also need to restart the Apache service in the aaPanel panel to make the configuration take effect.

Complete the initialization settings of AnQiCMS.

No matter whether you are using Nginx or Apache for reverse proxy, once the configuration takes effect, you can access your domain name through the browser (for examplehttp://test.anqicms.com/).At this moment, you should see the initial installation interface of AnQiCMS.Follow the prompts on the interface, fill in the database information, set the administrator account password, and complete the installation of AnQiCMS.

After installation, you can visit您的域名/system/Log in to the AnQiCMS admin interface and start your content creation and operation work.By manually configuring a reverse proxy, you not only solved the problem of failed automated deployment, but also deepened your understanding of the working principles of web workers.

Frequently Asked Questions (FAQ)

1. I have configured reverse proxy, but the domain name still cannot display the AnQiCMS page, how should I troubleshoot?

First, make sure that your AnQiCMS Docker container is running correctly in aaPanel.You can enter the Docker management interface of aaPanel and confirm that the container status is 'Running'.Next, check if the container's port mapping is correct, ensuring that the host port 8001 is indeed mapped to the AnQiCMS port inside the container.proxy_pass(Nginx) orProxyPass(Apache) points tohttps://en.anqicms.comThe service was restarted without any issues and after modifying the configuration.You can also view the Nginx/Apache error logs of the server and the AnQiCMS container logs to obtain more detailed error information.

2. Why is the target address of the reverse proxy127.0.0.1:8001not the internal IP address of the Docker container?

This is because when the Docker container starts, it will map its internal port (the default listening port of AnQiCMS) to a port on the host machine.127.0.0.1Is the local loopback address of the host machine, and8001Is Docker that exposes the container service to the host machine's port. Therefore, when Nginx or Apache perform reverse proxying on the host machine, it goes through127.0.0.1:8001The actual access is a service running in a Docker container called AnQiCMS.This approach avoids direct dependence on the container's dynamic internal IP address, improving the stability and robustness of the configuration.

3. How should I configure reverse proxy to run multiple AnQiCMS sites on the same server?

Implement multi-site AnQiCMS deployment in aaPanel, first you need to run an independent Docker container for each AnQiCMS instance, and make sure each container maps to a different port on the host machine (for example: the first 8001, the second 8002, and so on).Then, create an independent website for each AnQiCMS site in aaPanel and configure their reverse proxy separately.https://en.anqicms.compointing to the first AnQiCMS,http://127.0.0.1:8002pointing to the second AnQiCMS).After completing these reverse proxy configurations, you can use the powerful "Multi-site Management" feature in the backend of one of the AnQiCMS instances to add and manage all other sites, thereby achieving unified management.

Related articles

How to deploy AnQiCMS Docker application with aaPanel one-click?

As an experienced CMS website operation person in an enterprise, I am well aware of the importance of an efficient and stable content management system for both enterprises and individual operators.AnQi CMS, with its high concurrency characteristics of the Go language, concise architecture design, and in-depth optimization for SEO, has become the preferred choice for many small and medium-sized enterprises and self-media teams.

2025-11-06

How to set up port mapping and reverse proxy for AnQiCMS Docker container in Panel?

As an experienced senior CMS website operation person, I know the importance of efficient deployment and stable operation for any content management system.In the modern web environment, Docker container deployment is favored for its convenience, isolation, and portability.A strong and flexible content management platform can be provided for you by combining Anqi CMS with Docker.This article will elaborate on how to set up port mapping and reverse proxy for the AnQiCMS Docker container in the Panel environment, ensuring that your website can be accessed smoothly.

2025-11-06

How to use Docker to install and deploy AnQiCMS on 1Panel?

As an experienced website operator, I am well aware of the importance of an efficient and easy-to-manage content system for both enterprises and individual operators.AnQiCMS (AnQiCMS) is an ideal choice for many users seeking stable, flexible content solutions with its high-performance, modular design and rich built-in features based on the Go language.It not only deploys easily, with an elegant interface, but also excels in security and SEO-friendliness, meeting the needs of various content management requirements for corporate websites, marketing websites, and even personal blogs.

2025-11-06

What should I do if I encounter port occupation problem during AnQiCMS installation?

As a website operator who has been deeply involved in AnQiCMS for many years, I know that even a small technical detail can become a stumbling block for users to successfully go online.Among them, port occupation problems are typical scenarios often encountered when initially installing or expanding AnQiCMS.Today, let's delve into how to efficiently identify and resolve port occupation issues when installing AnQiCMS.Understanding Port Usage Problem First, let's understand what port usage is.In network communication

2025-11-06

How to configure MySQL database when installing AnQiCMS via Baota panel Docker?

As a senior security CMS website operator, I know that a stable and efficient CMS system cannot do without the robust support of its underlying database.Deploying AnQiCMS in the Docker environment of Baota panel not only simplifies the installation process but also provides an isolated, secure, and easy-to-manage application environment.Properly configuring the MySQL database is undoubtedly a key step to ensure the normal operation and data security of AnQiCMS.

2025-11-06

What are the specific field requirements for adding a new site in the AnQiCMS multi-site management?

As an experienced CMS website operation personnel, I fully understand the importance of the content management system in multi-site operations.AnQiCMS with its efficient and customizable features, provides us with great convenience in managing multiple brands or content branches.Adding a new site in AnQiCMS is a common operation that allows us to centralize the management of different sites into a single system.The following will elaborate on the specific requirements of the system for each field when adding a new site in AnQiCMS multi-site management.

2025-11-06

What are the naming conventions for the root directory and database in a multi-site AnQiCMS environment under Docker?

Deploying and managing AnQiCMS multi-site in Docker environment, it is crucial to follow a clear root directory and database naming convention to ensure system stability, maintainability, and future scalability.As an experienced website operator, I am well aware of the importance of these standards for the efficient operation of multiple sites. They can effectively avoid configuration conflicts, simplify troubleshooting procedures, and improve overall management efficiency.

2025-11-06

Who are the main user groups and application scenarios that AnQiCMS targets?

As an experienced website operator familiar with AnQiCMS, I fully understand the strategic significance of choosing a content management system.A great CMS is not only about technical implementation, but also about whether it can accurately meet user needs and empower business growth.AnQiCMS, as an enterprise-level content management system based on the Go language, its design philosophy and positioning of functions are clearly aimed at specific user groups and application scenarios.AnQi CMS is committed to providing strong support for users who seek efficient, customizable, and easily scalable content management solutions.Its core goal is to help small and medium-sized enterprises

2025-11-06