AnQiCMS is an efficient and scalable enterprise-level content management system that supports various deployment methods, including Docker container deployment.In an aaPanel server management panel like this, although it usually provides a convenient one-click deployment of Docker applications, in actual operation, users may sometimes encounter installation failures, resulting in the AnQiCMS Docker container not being properly configured with reverse proxy, causing the website to be unable to access normally.At this time, we can solve this problem by manually configuring a reverse proxy to ensure that your AnQiCMS website goes online smoothly.
Verify AnQiCMS Docker container status
Before starting to configure the reverse proxy, you first need to confirm that the AnQiCMS Docker container has been successfully started and is running.Even if the one-click deployment was not completely successful, the container itself may have already pulled and attempted to start.
You can view all deployed Docker containers by accessing the "Docker" option in the left menu of the aaPanel panel and then clicking "Container List."}On this interface, please check carefully if the AnQiCMS container exists, and confirm that its status is displayed as 'Running'.If the container status is "stopped" or not listed at all, you will need to manually create and start it.
Manually create AnQiCMS Docker container (if necessary)
If the one-click installation fails to start the AnQiCMS container, you can manually create and run it according to the following steps.
In the aaPanel Docker management interface, click the 'Create Container' button at the top of the page. In the pop-up configuration window, you need to fill in the following key information:
- name: Specify a recognizable name for your AnQiCMS container, for example
anqicms. - Mirror: Select the 'Manual Input' option and enter the official Docker image name of AnQiCMS:
anqicms/anqicms:latest. - Port Mapping: AnQiCMS container listens to the internal by default
8001Port. You need to map this internal port to an unused port on the server. Please check 'Expose Port' and fill in both the 'Server' and 'Container' sections.8001(If the server's port 8001 is occupied, please select a different, unused server port, such as 8002 or 8003, but the 'container' port should still be 8001). - Restart policy: To ensure that the AnQiCMS container can automatically recover after server restart or unexpected shutdown, it is recommended to select the option 'Restart after failure' or 'Restart if not manually stopped'.
After completing the above configuration, click the "Confirm" button to create the container.After the container starts, it will listen to the server port you specify in the port mapping (for example, 8001).You can connect to the server via SSH and run commandslsof -i:8001Please replace 8001 with the actual server port you are using to verify that the port is being listened on.
Manually configure reverse proxy in aaPanel.
After the AnQiCMS Docker container runs successfully and listens on a specific server port (such as 8001), you can then configure reverse proxy for it in aaPanel.
First, click the 'Website' option in the left menu of the aaPanel panel, and then select the 'Reverse Proxy' submenu.On the reverse proxy management interface, click the "Add Reverse Proxy" button.In the pop-up 'Add Reverse Proxy Site' configuration window, you need to fill in the following information accurately:
- DomainEnter the complete domain name you plan to use to access the AnQiCMS website, for example
your.anqicms.com. - Target URL: Points to the address and port that the AnQiCMS Docker container listens on locally. Usually, this will be
http://127.0.0.1:8001If you used a different server port when creating the container, please be sure to fill in the corresponding port number here.
Confirm all information is correct before clicking the 'Submit' button to complete the creation of the reverse proxy.
Nginx Advanced Configuration (Optional)
In some cases, you may need to configure Nginx reverse proxy more finely to optimize performance, handle specific URL rewrite rules, or resolve compatibility issues.
To add custom Nginx configuration, find the website you just created for AnQiCMS in aaPanel, click the 'Settings' button on the right.In the website settings interface, switch to the 'Configuration File' tab.You can add or modify instructions in the existing Nginx configuration file.An example of a commonly used Nginx configuration for AnQiCMS:
location @AnqiCMS {
proxy_pass http://127.0.0.1:8001;
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;
}
Please note that if you add the aforementionedlocationblock, make sure it does not conflict with other blocks generated automatically by aaPanellocationrules.try_filesAn instruction is a very flexible and powerful feature used to handle various URL requests.After modifying the configuration, be sure to click “Save” and restart the Nginx service to make the new configuration effective.
Access and initialize the AnQiCMS website
Now, all necessary configurations have been completed. You can enter the domain name you configured in the reverse proxy (for examplehttp://your.anqicms.com/) to access your AnQiCMS website.
First time